[Javascript] What is the equivalent of document.all in Netscape?
Peter Brunone
peter at brunone.com
Thu May 1 15:07:36 CDT 2003
Roland,
If you're trying to access a form field (checkbox in this case), you should go through the form collection like this:
var gtAll=document.formName.gradeTaught;
where formName is the name of the form that contains the checkboxes you're trying to analyze.
Regards,
Peter
---------- Original Message ----------------------------------
From: Roland Dong <rdong at cait.org>
>Hi, I have the following javascript but it only works in IE. The problem is
>document.all.gradeTaught. It does not works in Netscape. What is the
>equivalent code for Netscape?
>
> var gtChecked='';
> var gtAll=document.all.gradeTaught;
> for(var i=0; i<gtAll.length; i++)
> { if (gtAll[i].checked)
> { gtChecked=gtChecked+gtAll[i].value+"/";
> document.regForm.gradeTaughts.value=gtChecked;
> }
> }
>
>Thanks a lot,
>
>Roland
More information about the Javascript
mailing list