Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button

Status
Not open for further replies.

Maximus007

Technical User
Jul 26, 2004
248
US
Example:

The first page is the submission page which has the radio button

radio1
radio2
radio3

After clicking the submit but it take the user to review page. Now on the review page. It has

radio1
radio2
radio3
My question is how can I get the button that was checked from the submission page to appear checked on the review page also?
 
give each radio form element a different value but the same name... then on the receiving page check the value associated with the name and check the one that matches.
 
This within the value of a radio button on the receiving page

<%if Request("Question1")="A" then response.write("Checked")%>
 
yeah that looks about right, is it still giving your grief?
 
Yes nothing is checked on the recieveing. The submission pase ext is htm and receiving page ext is asp.

the reciving page radio button. do you know of an example I look. I know am close

 
No it didn't work! <input type="radio" name="Question1" value="<%if Request("Question1")="C" then response.write("check")%>"> it doesn't check the radio button on the receiving page.

 
I think what you want is more like this:

<input type="radio" name="Question1" value="<%Request("Question1")%>" <%if Request("Question1")="C" then response.write("checked")%>">

Setting the value to checked will not check the button that is only the value assigned to the button. You want the value of the button from the previous page in the value on this page and you want to set the checked parameter within the input tag so that it displays checked.



Paranoid? ME?? Who wants to know????
 
right but the first page, the htm page.... it probably had more than one radio button named Question1 ... they probably represented Answer A, B, and C... but when you pull it out of the Request object then the only Value you'll get is the one for the button that was actually selected.... so if you are going to show all of the radio buttons on the recieving ASP then you'll only get the value from that one that was selected... if thats the way its set up then you dont want to put the value in there like that.

what im trying to say is... on the htm page if you have this[tt]
What is your favorite color?
<input type="radio" name="Question1" value="A"> Red <br>
<input type="radio" name="Question1" value="B"> Green <br>
<input type="radio" name="Question1" value="C"> Blue <br>
[/tt]

Then on your asp you'll have something like this:
[tt]
What is your favorite color?
<input type="radio" name="Question1" value="A" <%if Request("Question1") = "A" then response.write "checked"%>> Red <br>
<input type="radio" name="Question1" value="B" <%if Request("Question1") = "B" then response.write "checked"%>> Green <br>
<input type="radio" name="Question1" value="C" <%if Request("Question1") = "C" then response.write "checked"%>> Blue <br>
[/tt]

sorry for the ugly formats
 
Thank you! What I was missing is the following:

<input type="radio" name="Question1" value="C"<% if Request("Question1")="C" then response.write("checked")%>">


Thank you guys very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top