Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Checkbox count

Posted on 2003-02-25
6
Medium Priority
?
925 Views
Last Modified: 2012-08-14
how do I get a count of the total number of checkboxes checked in a table?  I currently have a listing of records that display 20 per page and am using rs.RecordCount to count the total number of records. below is the code for the checkbox.

<%x_Printed = rs("Printed")%>
<input type="checkbox" disabled <%if (x_printed)=true then%>
checked value="True" >
<%else%>
>
<%end if%>
0
Comment
Question by:markneelon
5 Comments
 
LVL 4

Expert Comment

by:farzinm
ID: 8020570
You can have a variable to count
like this
<%
Dim count
count=0
x_Printed = rs("Printed")%>
<input type="checkbox" disabled <%if (x_printed)=true then
 count=count+1%>
checked value="True" >
<%else%>
>
<%end if%>
<%Response.write "Total checkbox count " & count%>
0
 
LVL 7

Accepted Solution

by:
chisholmd earned 200 total points
ID: 8020657
Do the checkboxes all have the same name?  Because once the form has been submitted you can use:

x = request.form("myCheckboxes").count

This will count only the checkboxes that have been checked because unchecked boxes do not return a name-value pair.

Dave

0
 
LVL 15

Expert Comment

by:gladxml
ID: 8023061
markneelon,

Maybe this link might help...

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20450556.html

HAppy programming...
0
 

Expert Comment

by:CleanupPing
ID: 9576857
markneelon:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 58

Expert Comment

by:Gary
ID: 9753843
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by chisholmd

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question