Hello! I was hoping someone would be able to give me some pointers with a problem of mine.
My code does not return true even when the the correct radiobutton is checked. Any help is appreciated!
<html>
<head>
<script type="text/javascript">
function validateForm()
{
var e=document.forms["myForm"]["guardiansPermission"].value;
if (e==null || e=="" || e==0)
{
alert("Permission must be given.");
return false;
}
</script>
</head>
<body>
<form name="myForm" action="form.asp" onsubmit="return validateForm()" method="post">
<input type='radio' name='guardiansPermission' value='1'> Yes
<input type='radio' name='guardiansPermission' value='0' checked> No
<input type="submit" value="Submit">
</form>
</body>
</html>
My code does not return true even when the the correct radiobutton is checked. Any help is appreciated!
<html>
<head>
<script type="text/javascript">
function validateForm()
{
var e=document.forms["myForm"]["guardiansPermission"].value;
if (e==null || e=="" || e==0)
{
alert("Permission must be given.");
return false;
}
</script>
</head>
<body>
<form name="myForm" action="form.asp" onsubmit="return validateForm()" method="post">
<input type='radio' name='guardiansPermission' value='1'> Yes
<input type='radio' name='guardiansPermission' value='0' checked> No
<input type="submit" value="Submit">
</form>
</body>
</html>