first of all, i suggest you name all of your checkboxes the same, unless you
have a different reason, and you should assign the ID's to the values of the
checkboxes. the reason for this is that all of the boxes checked will come
out in one form variable in a comma delimited list of their values. so
let's say I name all my check boxes Goober, and each of their values are the
ID's. Let's say I click on 3 boxes. The value of Form.Goober would be
34,54,22. something like that. See, it comes out as a comma delimited
list! ou also know how many boxes were checked by the number of values in
the list, which is 3. So Listlen(Form.Goober) is equal to 3!
>From: "Ann Harrell" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: Count check boxes?
>Date: Wed, 23 May 2001 13:12:22 -0500
>
>I have a list of 67 names each with a unique ID. I've given each check box
>a
>corresponding ID. I just want to count the number of boxes checked and
>output that number for now.
>
>If you want to know what a wobber is, go to www.wob-l.org at your own risk.
>
>Thanks!
>
>
><CFQUERY NAME="MetList" DATASOURCE="wobbersmet">
>SELECT Met_ID, FirstName, LastName
>FROM Wobbers
>ORDER BY Wobbers.Met_ID
></CFQUERY>
>
><FORM ACTION="MetListAction.cfm" METHOD="POST">
><TABLE WIDTH="45%">
> <TR>
> <TH ALIGN="LEFT">Met</TH>
> <TH ALIGN="LEFT">ID</TH>
> <TH ALIGN="LEFT">Name</TH>
> </TR>
> <CFOUTPUT QUERY="MetList">
> <TR>
> <TD><INPUT TYPE="checkbox" NAME="MetCheck#Met_ID#"
>VALUE=""></TD>
> <TD>#Met_ID#</TD>
> <TD>#FirstName# #LastName#</TD>
> </TR>
> </CFOUTPUT>
><TR>
> <TD COLSPAN="2"><INPUT TYPE="Submit" NAME="SubmitButton" VALUE="Count
>Wobbers Met"></TD>
></TR>
></table>
>
>Ann Harrell
>Mind like a steel trap..
>Rusty and illegal in 37 states.
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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