SeanPaul72
08-10-2003, 04:55 PM
I have the following radio button in a form<tr><td valign=top><i>1</i></td><td valign=top><i>Are there any judgments against you?</i>
<br></td>
<td align=center valign=top><input type=radio name="L230" value="Y"></td>
<td align=center valign=top><input type=radio name="L230" value="N"></td>
</tr>
My on submit handler looks like this:<form action=caddress.php name=lion1003 method=post onSubmit="return DataValSubmit('declarations')">
I have tried to vlidate the button searching for no values as follows: if(document.lion1003.L230.value == "")
{
alert('Please answer question 1');
document.lion1003.L231[0].focus();
return false;
}
This has no result.
So Then I tried to check for "N" or "Y" as follows:
if(document.lion1003.L230.value != "Y" || "N")
{
alert('Please answer question 1');
document.lion1003.L230.focus();
return false;
}
This returns False regardless if the radio button is checked or not.
So what do I need to do to validate a radio button selection of yes or no, vlue="Y" || "N" for type=radio name="L230"?
Thanks
<br></td>
<td align=center valign=top><input type=radio name="L230" value="Y"></td>
<td align=center valign=top><input type=radio name="L230" value="N"></td>
</tr>
My on submit handler looks like this:<form action=caddress.php name=lion1003 method=post onSubmit="return DataValSubmit('declarations')">
I have tried to vlidate the button searching for no values as follows: if(document.lion1003.L230.value == "")
{
alert('Please answer question 1');
document.lion1003.L231[0].focus();
return false;
}
This has no result.
So Then I tried to check for "N" or "Y" as follows:
if(document.lion1003.L230.value != "Y" || "N")
{
alert('Please answer question 1');
document.lion1003.L230.focus();
return false;
}
This returns False regardless if the radio button is checked or not.
So what do I need to do to validate a radio button selection of yes or no, vlue="Y" || "N" for type=radio name="L230"?
Thanks