PDA

View Full Version : Submit Button Going to Radio Button URL Value.



NavinRH
26 Jan 2011, 02:56 PM
How would i get the submit button of a form to go to a radio button url value. Ive been trying to find it online but it seems its never happened to anyone before.
Here is an example :

<form name="size" method="post" action="">
<input type="radio" name="Size21" value="/ShoppingCart.asp?ProductCode=SLI-Dirk-0004">
<input type="radio" name="Size21" value="/ShoppingCart.asp?ProductCode=SLI-Dirk-0005">

<input type="submit">
</form>

Is there some php or cgi that i could write to parse these values to attach as the form action?
Thanks

PerformanceDude
27 Jan 2011, 12:44 AM
You could add a onSubmit attribute on your form element. Use it to call a JavaScript method, which redirects to the value of the selected radio button, as described here:
http://www.somacon.com/p143.php