<SCRIPT LANGUAGE="JavaScript"> function go(loc) { if(loc ==''){ alert("please select a radio button"); } else window.location.href = loc; } function goTo(loc1){ document.form.selectedLoc.value = loc1; } </script> </HEAD> <BODY> <form name="form"> <input type="radio" name="loc" checked="checked" onClick="goTo('google.html');" > google<br> <input type="radio" name="loc" onClick="goTo('yahoo.html');"> yahoo<br> <input type="radio" name="loc" onClick="goTo('facebook.html');"> facebook<br> <input type="button" name="submit" value="submit" onclick="go(document.form.selectedLoc.value)"/> <input type="hidden" name="selectedLoc" value=""></input> </form>
goTo('google.html');
onload
<body onload="goTo('google.html');"></body>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)