Yesterday it was a style issue. Today it's radio buttons. I'm shocked to discover such incompatibility exists between IE and NS on what seem to me to be common tasks.
The following code performs as expected in IE, but not NS6. In NS6, the function gets called because I get the first alert. It seems as though the OR statement doesn't get evaluated.
All I need to know is if the user has checked either option. Any ideas on another approach?
(BTW, NS6 validates the other elements such as input boxes and select lists.)
<html>
<head>
<title>Test</title>
<script language="JavaScript1.2" type="text/javascript">
function ValidateForm(f) {
alert ("Function Called"
if ((f.TestA[0].checked) || (f.TestA[1].checked)){
alert ("Something Checked"
} else {
alert ("Nothing Checked"
}
}
</script>
</head>
<body>
<table border="1" cellpadding="5">
<form method="POST" action="" onSubmit="ValidateForm(this)">
<tr>
<td>Make a Choice</td>
<td>
Yes<input id="TestA" name="TestA" type="radio" value="Yes">
No<input id="TestA" name="TestA" type="radio" value="No">
</td>
<td><input type="submit" id="TestForm" name="TestForm" value="Test Function"></td>
</tr>
</form>
</table>
</body>
</html>
The following code performs as expected in IE, but not NS6. In NS6, the function gets called because I get the first alert. It seems as though the OR statement doesn't get evaluated.
All I need to know is if the user has checked either option. Any ideas on another approach?
(BTW, NS6 validates the other elements such as input boxes and select lists.)
<html>
<head>
<title>Test</title>
<script language="JavaScript1.2" type="text/javascript">
function ValidateForm(f) {
alert ("Function Called"
if ((f.TestA[0].checked) || (f.TestA[1].checked)){
alert ("Something Checked"
} else {
alert ("Nothing Checked"
}
}
</script>
</head>
<body>
<table border="1" cellpadding="5">
<form method="POST" action="" onSubmit="ValidateForm(this)">
<tr>
<td>Make a Choice</td>
<td>
Yes<input id="TestA" name="TestA" type="radio" value="Yes">
No<input id="TestA" name="TestA" type="radio" value="No">
</td>
<td><input type="submit" id="TestForm" name="TestForm" value="Test Function"></td>
</tr>
</form>
</table>
</body>
</html>