Have the checkbox which triggers it call a function instead
<input type="checkbox" onClick="if (this.checked) checkAll(this.form);">
then in the function to check the status decide whether you want to call
the checkAll function or a function which unchecks them all.
function checkStatus( chkbx ){
if (chkbx.checked == true){
checkAll(this.form);
} else {
unCheckAll(this.form);
}
}
HTH
Kola
>> -----Original Message-----
>> From: Robertson-Ravo, Neil (REC) [mailto:Neil.Robertson-
>> [EMAIL PROTECTED]]
>> Sent: 21 October 2002 20:51
>> To: '[EMAIL PROTECTED] '
>> Subject: RE: [ cf-dev ] Checkboxes
>>
>> Yep, but you got any idea on how to trigger it?!
>>
>> -----Original Message-----
>> From: Kola Oyedeji
>> To: [EMAIL PROTECTED]
>> Sent: 21/10/02 20:47
>> Subject: RE: [ cf-dev ] Checkboxes
>>
>> I think you use the same principal but
>> set checked to false (without quotes)
>>
>> HTH
>>
>> Kola
>>
>> > >-----Original Message-----
>> > >From: Robertson-Ravo, Neil (REC)
>> > >[mailto:Neil.Robertson-Ravo@;csd.reedexpo.com]
>> > >Sent: 21 October 2002 20:38
>> > >To: '[EMAIL PROTECTED]'
>> > >Subject: [ cf-dev ] Checkboxes
>> > >
>> > >
>> > >Hi Guys,
>> > >
>> > >I have this code which checks all checkboxes in a form :
>> > >
>> > >function checkAll(theForm) {
>> > > for (i=0,n=theForm.elements.length;i<n;i++)
>> > > if (theForm.elements[i].name.indexOf('chkmsg') !=-1)
>> > > theForm.elements[i].checked = true;
>> > >}
>> > >
>> > >I then call it via another checkbox :
>> > >
>> > ><input type="checkbox" onClick="if (this.checked)
>> checkAll(this.form);">
>> > >
>> > >This all works AOK except that I am missing the code to uncheck
>> > >them!!! Can
>> > >anyone point me in the right direction with a solution?! I am
sure
>> its
>> > >fairly simple, but I just cant see it as of yet :-(
>> > >
>> > >I want it to work on a checkbox and not on an image like many
>> > >solutions have
>> > >! any idea?
>> > >
>> > >N
>> > >
>> > >
>> > >
>> > >--
>> > >** Archive:
>> http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>> > >
>> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > >For additional commands, e-mail: [EMAIL PROTECTED]
>> > >For human help, e-mail: [EMAIL PROTECTED]
>> > >
>>
>>
>> --
>> ** Archive:
http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>>
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> For human help, e-mail: [EMAIL PROTECTED]
>>
>> --
>> ** Archive:
http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>>
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]