Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    support to disable form controls with javascript in netscape communicator 4.76

    Hi,
    My code to disable checkbox using onclick is not working on netscape communicator 4.76.
    However it is working fine in later versions of IE & Netscape.
    Is there any other way of implementing the same funtionality
    without changing netscape version.(netscape 4.76 is all that I can use)
    The code:
    <html>
    <head>
    <script language=javascript>
    function a(){
    if (document.form1.check1.checked == true)
    {document.form1.check2.setAttribute('disabled',true);}
    else
    {document.form1.check2.removeAttribute('disabled'); }
    }
    </script>
    </head>
    <body>
    <form name=form1>
    <input type="checkbox" name="check1" onClick="a();">
    <input type="checkbox" name="check2" >
    </form>
    </body>
    </html>
    Last edited by anirbang; 04-30-2008 at 01:28 PM.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    NS4.x is an old browser, it does not support DOM 2+ methods.
    Try:
    Code:
    if (document.form1.check1.checked == true)
    {document.form1.check2.disabled=true}
    else
    {document.form1.check2.disabled=false}
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks

    I also tried the method you mentioned before hand it is not working either

    The code:
    <html>
    <head>
    <script language=javascript>
    function a(){
    if (document.form1.check1.checked == true)
    {document.form1.check2.disabled=true;}
    else
    {document.form1.check2.disabled=false;}
    }
    </script>
    </head>
    <body>
    <form name=form1>
    <input type="checkbox" name="check1" onClick="a();">
    <input type="checkbox" name="check2" >
    </form>
    </body>
    </html>

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    You are still supporting a browser that is 10+ years old?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    New to the CF scene
    Join Date
    Apr 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So is there no way to disable form controls in netscape communicator 4.76.
    How the coders of that time used to disable form controls.
    If disable method was not supported at that time.

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    In theory should work. Unfortunately I have no Netscape 4.7 to test...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    Regular Coder
    Join Date
    Mar 2006
    Posts
    725
    Thanks
    35
    Thanked 132 Times in 123 Posts
    I also can't remember if netscape 4 let you change a form element's disabled property with a script-
    but I would use a pair of radio inputs in your situation, so that only one can be selected.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •