Print Page | Close Window

Percentage of checkboxes ticked

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=7328
Printed Date: 01 April 2026 at 1:00am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Percentage of checkboxes ticked
Posted By: GregD
Subject: Percentage of checkboxes ticked
Date Posted: 17 November 2003 at 7:59am
Hi, Im trying to work out a way of getting a percentage of checkboxes which are ticked on a form in asp. All the checkboxes have certain names so I need to cater for this also as there are several groups of checkboxes which need individual percentages.

For the first set of checkboxes the names are:
bolQAA;bolQAB;bolQAC;bolQAD;bolQAE;bolQAF;bolQAG;bolQAH;bolQ AI;bolQAJ;bolQAK;bolQAL;bolQAM;bolQAN;bolQAO

Any help appreciated

Greg



Replies:
Posted By: MorningZ
Date Posted: 17 November 2003 at 12:09pm

15 mins with some javascript, hope this helps

http://www.morningz.com/sections/playground/files/code/CheckCount.htm - View source to see the code

 



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Gullanian
Date Posted: 17 November 2003 at 1:16pm

Or if you want to do it in ASP, loop through all the checkboxes in the form:

For each checkboxname in formname

In the loop add to a counter which counts total number of boxes, and also in the loop if the checkbox is checked add one to another counter, then do a simple maths calculation to determine the % checked




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net