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

radio redirect

Status
Not open for further replies.

MikeL91

Programmer
Feb 8, 2001
100
US
is the best way to conditionally redirect my page based on the value of 2 radio buttons, to make the action on the submit goto a asp page and just pass the request.form("value") to a variable, and then make a if statement to redirect based on the if statement?

radio:
<input type=radio value=111 name=Processed0> -option 1
<input type=radio value=113 name=Processed0> -option 2

here is the submit:
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot; Submit Order &quot;>

OR is there a way to do it in the same page?

thanks,
mike
 
using vbscript you could have the this:

<script language=vbscript>
sub submitform()
if form1.processed.value = &quot;111&quot; then
form1.action = &quot;page1.asp&quot;
form1.submit
else
form1.action = &quot;page2.asp&quot;
form1.submit
end if
end sub
</script>

and here is your button:

<input type=&quot;button&quot; onclick=submitform() name=&quot;button1&quot; value=&quot;Submit&quot;>


hope that helps
mwa
 
In addition, if you use the previous script tha nyou don't lose any of your form information as you would with a response.redirect.
-Tarwn The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch, and a user with an idea
-computer saying (Wiz Biz - Rick Cook)
 
I am getting an error:

&quot;object does not support this property or method form1.Processed0.value&quot;

what am i doing wrong?

here is my code:

<script language=vbscript>
sub submitform()
if form1.Processed0.value=&quot;111&quot; then
form1.action=&quot; form1.submit
else
form1.action=&quot; form1.submit
end if
end sub
</script>

radios
<input type=radio value=113 name=Processed0>
<input type=radio value=137 name=Processed0>


submit button:
<input type=&quot;submit&quot; onclick=submitform() name=&quot;Submit&quot; value=&quot; Submit Order &quot;>


-Mike
 
Try
Code:
form1.processed0[0].checked
That should tell you if element 0 (in the above case 113) is checked by returning a boolean value.
-Tarwn The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch, and a user with an idea
-computer saying (Wiz Biz - Rick Cook)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top