Javascripts > Javascript Forms > Go To Link onClick of Radio Button
Script Title: Go To Link onClick of Radio Button
Description: This script allow user to go on a link page after a radio button is clicked.
Example: Available
Copy the following code into your <HEAD></HEAD> tags.<script language="Javascript" type="text/javascript"> function gotolink() { var destination= self.location; for(var i = 0; i<document.formname.radiobutton.length; i++){ if(document.formname.radiobutton[i].checked) { destination=document.formname.radiobutton[i].value } } window.location = destination; } </script>
Copy the following code between the <BODY></BODY> tags of your html page.<form name="formname"> <input name="radiobutton" type="radio" value="http://www.free-backgrounds.com" onClick="gotolink()">Free Backgrounds<br> <input name="radiobutton" type="radio" value="http://www.graphxkingdom.com" onClick="gotolink()">Free Clipart<br> <input name="radiobutton" type="radio" value="http://www.reallybig.com" onClick="gotolink()">ReallyBig<br> </form>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email