Hi guys/gals,
I have two radio buttons in my form. when a user clicks the submit button i want the browser to take them to either [url]www.abc.com[url]www.xyz.com
[code]
<html><head><script language=”JavaScript”>
function checkRadio(){
var url;
if (document.checkform.radios[0].checked)
{
alert(“abc”);
window.location.href= “http://www.abc.com”;
}else if(document.checkform.radios[1].checked){
alert(“xyz”);
window.location.href= “http://www.xyz.com”;
}
}
</script>
</head>
<body>
<form name=”checkform” action=”” onsubmit=”checkRadio()”>
<p>
<input name=”radios” type=”radio” value=”radiobutton1″ />
<strong>I want to go to abc.com </strong></p>
<p>
<input name=”radios” type=”radio” value=”radiobutton2″ />
<strong>I want to go to xyz.com </strong></p>
<p><strong>
<input name=”Enter” type=”submit” id=”Enter” value=”Enter” />
</strong></p>
<p><strong>
<input type=”checkbox” name=”checkbox” value=”checkbox” />
Remember my choice
</strong></p>
</form>
</body>
</html>
Thanks in advance ?
Also if i wanted to be able to remember the user’s choice so next time it automatically redirects him/her..whats the quickest way to do that..
cheers