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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Radio buttons value between 2 asp files 2

Status
Not open for further replies.

RonenW

Programmer
Jan 17, 2001
4
0
0
IL
Hi,
I would like to know how can I pass a radio button value between two asp files ?

Thanks,
RonenW.
 
You must put the radio button inside a form in file1.
Then other using "get" or "post" you can submit the form to the next file.
<form action=&quot;File2.asp&quot; method=&quot;post&quot; name=&quot;Form1&quot;>

You can access it from File2 using
Request.Form(&quot;RadioButtonName&quot;)
Hope this is what you were looking for
 
Note that if you are using a bunch of radio buttons, it will return the value for the selected one (or nothing if none were selected). I.E.:

<form action=&quot;file2.asp&quot; method=&quot;post&quot; name=&quot;Form1&quot;>
<input type=&quot;radio&quot; name=&quot;test1&quot; value=&quot;1&quot;>
<input type=&quot;radio&quot; name=&quot;test1&quot; value=&quot;2&quot;>
<input type=&quot;radio&quot; name=&quot;test1&quot; value=&quot;3&quot;>
<input type=&quot;radio&quot; name=&quot;test1&quot; value=&quot;4&quot;>
<input type=&quot;radio&quot; name=&quot;test1&quot; value=&quot;5&quot;>

<input type=&quot;submit&quot; name=&quot;btnSubmit&quot; value=&quot;Send it&quot;>
</form>

and if I select the second radio button, it will return a 2 when I use Request.Form(&quot;test1&quot;). If I don't select any, it will return &quot;&quot; (a blank string). Make sure your radio buttons in a set have the same name if you only want to select one out of a set of them. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top