I would like a form to have say 3 radio buttons and a submite button. if radio button a is selected the page will load [url]www.a.com[/url] when button is clicked. if b is selected [url]www.b.com[/url] will be loaded on button click and so on.
Any ideas?
[code=html]<html> <head> <script type="text/javascript"> function goPage(eI) { var val = "default"; for (var i=0; i<eI.length; i++) { if (eI[i].checked == true) val = eI[i].value; } top.location='http://www.'+val+'.com'; } </script> </head> <body> <form> <input type="radio" name="raisedOn" value="a"/>a<br/> <input type="radio" name="raisedOn" value="b"/>b<br/> <input type="radio" name="raisedOn" value="c"/>c<br/> <input type="button" value="Submit" onclick="goPage(raisedOn)"/> </form> </body> </html>[/code]
Help @k_pilkington spread the word by sharing this article on Twitter...