[Javascript] How to disable by id in Mozilla

Chris Tifer christ at saeweb.com
Wed Sep 24 14:31:55 CDT 2003


I might be mistaken, but ID's are supposed to be unique. Are you saying you
have multiple elements with the same ID?


----- Original Message ----- 
From: "Guy Platt" <guy at webbnet.com>
To: <javascript at LaTech.edu>
Sent: Wednesday, September 24, 2003 3:26 PM
Subject: [Javascript] How to disable by id in Mozilla


> Hi,
>
> I'm trying to enable a fieldset (or a bunch of form fields) based on a
> checkbox.
>
> The following works great in IE 6 but I'd like to be able to do the same
> in Mozilla.
>
> I'd really appreciate it if anyone could help me code tis in a way which
> will work for both IE and Mozilla?
>
> <script type="text/javascript">
> function enable()
> {
> if (document.getElementById('CheckBox3').checked) {
>         document.getElementById('extrafields').disabled = false;
> } else {
>         document.getElementById('extrafields').disabled = true;
> }
> }
>
> Many thanks
>  Guy
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list