Check All boxes function not working.....help!

Hi forum,

Here’s a problem I got in generating a script for check all/Uncheck all.

Please help…

Here’s the info…

Calling the function…

<input name="allbox" id="allbox" type="checkbox" onClick="javascript: CheckAll(document.state);" title="Check All/ Uncheck All"/>

and here’s the function:

function CheckAll(fmobj) {
    //alert(fmobj.elements.length)
  for (var i=0; i<fmobj.elements.length; i++) {
    var e = fmobj.elements[i];
    if ( (e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled) ) {
      e.checked = fmobj.allbox.checked;
    }
  }
}

The problem is…when I click on the check box…it doesn’t select all the check box, only the one I am clicking on…

Thanks in advance!!

Don’t use the javascript: pseudo-protocol.

Try:

onclick = "CheckAll( this.form );"

Are there any console errors?

Thanks Ali…its working…thanks a lot.