[Javascript] How to disable by id in Mozilla

Guy Platt guy at webbnet.com
Wed Sep 24 14:26:20 CDT 2003


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





More information about the Javascript mailing list