Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello all. I am having a problem

Status
Not open for further replies.

smsinger3

Programmer
Oct 5, 2000
192
US
Hello all.

I am having a problem with this function. It turns on and off checkboxes. For some reason, this does not work in Netscape 6.2. I get the following error: "document.form1.elements is not a function"

Does anyone know why? Thanks!


================================================
function CheckAll(blnCheck){
var i;
for(i=0;i<document.form1.elements.length;i++){
if(document.form1.elements(i).type==&quot;checkbox&quot;){
document.form1.elements(i).checked=blnCheck;
}
}
}
 
Well, I believe I answered my question. I did 2 things wrong:

1) Post this question in the wrong forum! It should have obviously been the Javascript forum (sorry).
2) The parenthesis should have been brackets! i.e. document.form1.elements[i].type

I hate those kinds of mistakes!

Happy Holidays.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top