How do I maintain state of a radio button

M

Mike

I have a page with a group of 3 radio buttons. When each of the them
is selected, different content with submit form will render below it.
By default, radio button A is selected with content A below it. I did
this with a body onLoad calling a "show" function for content A. My
issue is, when a user selects different radio buttons (B or C), submit
the form, and returns to the page, radio button A is selected with its
content. I would like the same radio button selected, how do I do
that?

Thanks!
 
L

Leif K-Brooks

Mike said:
I have a page with a group of 3 radio buttons. When each of the them
is selected, different content with submit form will render below it.
By default, radio button A is selected with content A below it. I did
this with a body onLoad calling a "show" function for content A.

And have you tested it with JavaScript off?
My issue is, when a user selects different radio buttons (B or C),
submit the form, and returns to the page, radio button A is
selected with its content. I would like the same radio button
selected, how do I do that?

Use your server-side script to store the selected radio button in a
cookie (or session, if you have such a feature available).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top