Hi there,
I'm not quite sure what im doing wrong so here is what i need. Simply, i have two radio buttons. I just need to validate if one has been checked, which one. What is the simplest way to do this, or what am i doing wrong?
here is what i've got:
<HTML>
<head>
<script language="javascript">
function validate(){
if (!document.form.waiver.checked)
{
window.alert ("You must answer the waiver question."
;
document.form.waiver.focus();
return false;
}
}
</script>
</head>
<body>
<form name="form" onSubmit="return validate()">
<table class="tiny" border="0" width="100" align="center">
<tr>
<td width align="right" valign><input type="RADIO" name="waiver" value="yes" size>Yes</td>
<td width align="left" valign><input type="RADIO" name="waiver" value="no" size>No</td>
</tr>
</table>
<table class="tiny" border="0" cellspacing="5" cellpadding="0" width="90%">
<tr>
<td width="" align="right" valign="center">
<dd><input type="Submit" name="sub" value="Submit" align="right" width="50" height="50"></dd>
</td>
<td width="" align="left" valign="center"><div>
<dd><input type="Reset" name value="Reset" align="center" width="50" height="50"></dd>
</div></td>
</tr>
</table>
</body>
</html>
Please and Thanks
David Stephens >
:O>
I'm not quite sure what im doing wrong so here is what i need. Simply, i have two radio buttons. I just need to validate if one has been checked, which one. What is the simplest way to do this, or what am i doing wrong?
here is what i've got:
<HTML>
<head>
<script language="javascript">
function validate(){
if (!document.form.waiver.checked)
{
window.alert ("You must answer the waiver question."
document.form.waiver.focus();
return false;
}
}
</script>
</head>
<body>
<form name="form" onSubmit="return validate()">
<table class="tiny" border="0" width="100" align="center">
<tr>
<td width align="right" valign><input type="RADIO" name="waiver" value="yes" size>Yes</td>
<td width align="left" valign><input type="RADIO" name="waiver" value="no" size>No</td>
</tr>
</table>
<table class="tiny" border="0" cellspacing="5" cellpadding="0" width="90%">
<tr>
<td width="" align="right" valign="center">
<dd><input type="Submit" name="sub" value="Submit" align="right" width="50" height="50"></dd>
</td>
<td width="" align="left" valign="center"><div>
<dd><input type="Reset" name value="Reset" align="center" width="50" height="50"></dd>
</div></td>
</tr>
</table>
</body>
</html>
Please and Thanks
David Stephens >