BTW: a GREAT Javascript resource, http://irt.org/  (irt stands for Internet
Related Technologies)

<script>
function checkAll() {
  document.formName.chk1.checked=true; 
  document.formName.chk2.checked=true; 
  document.formName.chk3.checked=true;
}
</script>

Or just give the checkboxes a name starting with something recognisable, 
like chk_: 

<script language="JavaScript">
<!--
function checkAll(theForm) {
    for (i=0,n=theForm.elements.length;i<n;i++)
        if (theForm.elements[i].name.indexOf('chk__') !=-1)
            theForm.elements[i].checked = true;
}
//--></script>

 

-----Original Message-----
From: Bosky, Dave [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 12:08 PM
To: CF-Talk
Subject: checking multiple boxes w/single button?



I have a form containing a dynamic list of checkboxes that 
are used to delete messages.  I already have a button that 
will delete all checked mail but my question is how do I 
make a button that will automatically put a check in each box?
<!-----
<form name="msglist" action="" method="">
        <cfoutput query= "msgs">
        <input type="checkbox" name="MsgsToDelete" value="#MessageNumber#">
        </cfoutput>
<input type="button" value="CheckMail" onClick="checkAll();">
<form>
---->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to