Hello,
I am not a javascripter however I have a simple need to a yes no question before someone can fill out a form. Bloew is what I have. If they click yes I’ll take them to the form, if no then I will redirect them to a different page. I can not get it to work. Any help would be appreciated.
<script type="text/javascript">
<!--
function valbutton(thisform) {
if(thisform.myradiobutton.checked==true){
var radiovalue = thisform.myradiobutton.value;
if(radiovalue == "yes"){
window.location = "http://www.google.com/";
} else {
window.location = "http://www.gmail.com/";
}
}
return false;
}
//-->
</script>
<form name="myform" method="POST">
<input type="radio" value="yes" name="myradiobutton" />yes<br />
<input type="radio" value="no" name="myradiobutton" />no<br />
<input type="submit" name="submitit" onclick="valbutton(myform);" value="Validate" />
</form>
Thanks
Tim