This script works in IE but not in Netscape. I get this error message when I click on a radio button:
JavaScript Error: file:/c|/winnt/temp/hs~new.htm, line 52:
form1 is not defined.
JavaScript Error: file:/c|/winnt/temp/hs~new.htm, line 47:
form1 is not defined.
Here's the code:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form name="form1" method="post" action="">
<table border="0" cellpadding="0" cellspacing="2">
<tr>
<td><input type="radio" name="gr1" value="Yes" onClick="Disab(1)"></td>
<td>US History 10</td>
<td><input type="checkbox" name="UHist10_01A" value="Yes" disabled></td>
<td>Section 01A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input type="checkbox" name="UHist10_02A" value="No" disabled></td>
<td>Section 02A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input name="UHist10_03A" type="checkbox" disabled id="UHist10_03A" value="Yes"></td>
<td>Section 03A</td>
</tr>
<tr><td colspan="4"> </td></tr>
<tr>
<td><input type="radio" name="gr1" value="No" onClick="Disab(2)"></td>
<td>US History 11</td>
<td><input type="checkbox" name="UHist11_01A" value="Yes" disabled></td>
<td>Section 01A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input type="checkbox" name="UHist11_02A" value="No" disabled></td>
<td>Section 02A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input name="UHist11_03A" type="checkbox" disabled id="UHist11_03A" value="No"></td>
<td>Section 03A</td>
</tr>
</table>
</form>
<SCRIPT LANGUAGE="JavaScript">
function Disab (val) {
if(val=="1" {
form1.UHist10_01A.disabled=false;
form1.UHist11_01A.disabled=true;
form1.UHist11_01A.checked=false;
form1.UHist10_02A.disabled=false;
form1.UHist11_02A.disabled=true;
form1.UHist11_02A.checked=false;
form1.UHist10_03A.disabled=false;
form1.UHist11_03A.disabled=true;
form1.UHist11_03A.checked=false;
}
if(val=="2" {
form1.UHist11_01A.disabled=false;
form1.UHist10_01A.disabled=true;
form1.UHist10_01A.checked=false;
form1.UHist11_02A.disabled=false;
form1.UHist10_02A.disabled=true;
form1.UHist10_02A.checked=false;
form1.UHist11_03A.disabled=false;
form1.UHist10_03A.disabled=true;
form1.UHist10_03A.checked=false;
}
}
</SCRIPT>
</body>
</html>
JavaScript Error: file:/c|/winnt/temp/hs~new.htm, line 52:
form1 is not defined.
JavaScript Error: file:/c|/winnt/temp/hs~new.htm, line 47:
form1 is not defined.
Here's the code:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form name="form1" method="post" action="">
<table border="0" cellpadding="0" cellspacing="2">
<tr>
<td><input type="radio" name="gr1" value="Yes" onClick="Disab(1)"></td>
<td>US History 10</td>
<td><input type="checkbox" name="UHist10_01A" value="Yes" disabled></td>
<td>Section 01A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input type="checkbox" name="UHist10_02A" value="No" disabled></td>
<td>Section 02A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input name="UHist10_03A" type="checkbox" disabled id="UHist10_03A" value="Yes"></td>
<td>Section 03A</td>
</tr>
<tr><td colspan="4"> </td></tr>
<tr>
<td><input type="radio" name="gr1" value="No" onClick="Disab(2)"></td>
<td>US History 11</td>
<td><input type="checkbox" name="UHist11_01A" value="Yes" disabled></td>
<td>Section 01A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input type="checkbox" name="UHist11_02A" value="No" disabled></td>
<td>Section 02A</td>
</tr>
<tr>
<td colspan="2"> </td>
<td><input name="UHist11_03A" type="checkbox" disabled id="UHist11_03A" value="No"></td>
<td>Section 03A</td>
</tr>
</table>
</form>
<SCRIPT LANGUAGE="JavaScript">
function Disab (val) {
if(val=="1" {
form1.UHist10_01A.disabled=false;
form1.UHist11_01A.disabled=true;
form1.UHist11_01A.checked=false;
form1.UHist10_02A.disabled=false;
form1.UHist11_02A.disabled=true;
form1.UHist11_02A.checked=false;
form1.UHist10_03A.disabled=false;
form1.UHist11_03A.disabled=true;
form1.UHist11_03A.checked=false;
}
if(val=="2" {
form1.UHist11_01A.disabled=false;
form1.UHist10_01A.disabled=true;
form1.UHist10_01A.checked=false;
form1.UHist11_02A.disabled=false;
form1.UHist10_02A.disabled=true;
form1.UHist10_02A.checked=false;
form1.UHist11_03A.disabled=false;
form1.UHist10_03A.disabled=true;
form1.UHist10_03A.checked=false;
}
}
</SCRIPT>
</body>
</html>