[thelist] JS, counting selected checkboxes

Warden, Matt mwarden at odyssey-design.com
Tue Jan 23 00:05:31 CST 2001


> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> : From: Warden, Matt
> :
> : Why are you decrementing the variable
> : numberChecked if the checkbox isn't checked?
> : Wouldn't it just stay the same, unless the
> : checkbox is checked (in which case it would
> : increment)?
> :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> let's say i check 10 boxes and realize that there was another choice of the
> one's that aren't checked that should be part of the 10.  the numberChecked
> variable has been incremented to 10.  so, in order to reflect the true
> number of boxes checked, you'd have to decrement that count when a box is
> unchecked.
>
> make more sense?


Oh, so you're were saying to put this as the onClick event for the checkbox? I
guess that would be the way to do it. Brilliant!


--
mattwarden
mattwarden.com





More information about the thelist mailing list