Another possibility is that with form elements like fieldset, label, legend - possibly others, there is no type attribute, so when testing, you would need to do:
Code:
if(f.elements[i].type && f.elements[i].type == "checkbox")
To really be on the safe side, though this shouldn't be required with valid markup, you can even do:
Code:
if(f.elements[i] && f.elements[i].type && f.elements[i].type == "checkbox")
If you want more help:
Please post a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks