Javascript baby!

You can change the checked status of a checkbox by...

document.formname.checkboxname[x].checked = true/false;

x being the occurance of that set of checkboxes with the same name, starting
with 0...

So if you know, for instance, that you have 20 checkboxes and you want a
'check all' box...

for (x = 0; x LTE 19; x = x + 1); {
    document.formname.check[x].checked = false;
}

I'm sure there's a way to query a set of checkboxes and see how many
elements there are, and set your for loop to that... just don't know it off
the top of my head.

--Scott

----- Original Message -----
From: "Bosky, Dave" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 1:07 PM
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to