By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,256 Members | 1,663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,256 IT Pros & Developers. It's quick & easy.

Counting checked checkboxes in a form

P: n/a
It's possible to count the checked checkboxes in a form ?

If so, how?
Bye Raffaele
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


trettr wrote:
It's possible to count the checked checkboxes in a form ?

If so, how?


var formControls = document.formName.elements;
var c = 0;
for (var i = 0; i < formControls.length; i++)
if (formControls[i].type.toLowerCase() == 'checkbox'
&& formControls[i].checked)
c++;
alert(c)

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.