Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: SV: Disable Checkbox script won't work in Netscape


Message #1 by "Robert Nyman" <robert.nyman@c...> on Tue, 10 Dec 2002 17:50:49 +0100
What version of Netscape are we talking about?
Netscape 4 doesn't support the disabled property...


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: A Davis [mailto:casa3311@h...]
Skickat: den 10 december 2002 16:51
Till: JavaScript HowTo
=C4mne: [javascript_howto] Disable Checkbox script won't work in 
Netscape


How do I get this code to work in Netscape:

<pre>
<html>
<head>
<title>Untitled</title>

</head>
<body>
<form name=3D"form1" id=3D"form1" method=3D"post" action=3D"">
  <table border=3D"0" cellpadding=3D"0" cellspacing=3D"2">
    <tr>
      <td><input type=3D"radio" name=3D"gr1" value=3D"Yes" 
onClick=3D"Disab
(1)"></td>
      <td>US History 10</td>
      <td><input type=3D"checkbox" name=3D"UHist10_01A" value=3D"Yes"
disabled></td>
      <td>Section 01A</td>
    </tr>
    <tr>
      <td colspan=3D"2">&nbsp;</td>
      <td><input type=3D"checkbox" name=3D"UHist10_02A" value=3D"No"
disabled></td>
      <td>Section 02A</td>
    </tr>
    <tr>
      <td colspan=3D"2">&nbsp;</td>
      <td><input name=3D"UHist10_03A" type=3D"checkbox" disabled
id=3D"UHist10_03A" value=3D"Yes"></td>
      <td>Section 03A</td>
    </tr>
    <tr><td colspan=3D"4">&nbsp;</td></tr>
    <tr>
      <td><input type=3D"radio" name=3D"gr1" value=3D"No" 
onClick=3D"Disab
(2)"></td>
      <td>US History 11</td>
      <td><input type=3D"checkbox" name=3D"UHist11_01A" value=3D"Yes"
disabled></td>
      <td>Section 01A</td>
    </tr>
    <tr>
      <td colspan=3D"2">&nbsp;</td>
      <td><input type=3D"checkbox" name=3D"UHist11_02A" value=3D"No"
disabled></td>
      <td>Section 02A</td>
    </tr>
    <tr>
      <td colspan=3D"2">&nbsp;</td>
      <td><input name=3D"UHist11_03A" type=3D"checkbox" disabled
id=3D"UHist11_03A" value=3D"No"></td>
      <td>Section 03A</td>
    </tr>
  </table>
</form>
<SCRIPT LANGUAGE=3D"JavaScript">
function Disab (val) {
  if(val=3D=3D1) {
    document.form1.UHist10_01A.disabled=3Dfalse;
document.form1.UHist11_01A.disabled=3Dtrue;
document.form1.UHist11_01A.checked=3Dfalse;
    document.form1.UHist10_02A.disabled=3Dfalse;
document.form1.UHist11_02A.disabled=3Dtrue;
document.form1.UHist11_02A.checked=3Dfalse;
    document.form1.UHist10_03A.disabled=3Dfalse;
document.form1.UHist11_03A.disabled=3Dtrue;
document.form1.UHist11_03A.checked=3Dfalse;
  }
  if(val=3D=3D2) {
    document.form1.UHist11_01A.disabled=3Dfalse;
document.form1.UHist10_01A.disabled=3Dtrue;
document.form1.UHist10_01A.checked=3Dfalse;
    document.form1.UHist11_02A.disabled=3Dfalse;
document.form1.UHist10_02A.disabled=3Dtrue;
document.form1.UHist10_02A.checked=3Dfalse;
    document.form1.UHist11_03A.disabled=3Dfalse;
document.form1.UHist10_03A.disabled=3Dtrue;
document.form1.UHist10_03A.checked=3Dfalse;
  }
}
</SCRIPT>
</body>
</html>

</pre>



  Return to Index