View Single Post
08-20-2008, 02:18 AM
#2
xdoomx is offline xdoomx
Status: Member
Join date: Feb 2005
Location: Quebec, Canada
Expertise:
Software:
 
Posts: 441
iTrader: 1 / 100%
 

xdoomx is on a distinguished road

Send a message via AIM to xdoomx Send a message via MSN to xdoomx

  Old

Code:
function countCheckBoxes(){
	var checkboxes = document.getElementsByTagName("INPUT");
	var total = 0
	for(i=0;i<checkboxes.length;i++){
		if(checkboxes[i].checked) total ++;
	}
	alert(total);
}
This should work, might behave funny if there's more than one form with checkboxes or radio buttons in the page, but that can always be fixed.