I have a list of checkbox which have the same name but diffrent value.I add in another "select all" checkbox where when user click it , all the checkbox will be checked and unchecked correspondingly. <BR><BR>my code here work fine if there is more than one checked.But if there is only one checkbox, the length will return an "undefine" value.Thank for anybody who can help me.<BR><BR> function CheckAll(fieldname) {<BR> <BR> for ( i = 0; i &#060; fieldName.length; ++i ) {<BR> if (fld[i].name != "allbox") { <BR> fld[i].checked = document.cameraList.allbox.checked<BR> }<BR> }<BR> }<BR><BR><BR>allbox is the name of the "select all" check box