Hi Fabien,

If you have this html

<form>
<input type="checkbox" checked="checked" />
<input type="checkbox" />
<input type="checkbox" checked="checked" />
</form>

you can get number of checked chechboxes with this (this is irb session)

irb> checked = 0
=> 0
irb> ie.form(:index, 1).checkboxes.each {|checkbox| checked = checked +1 if
checkbox.checked?}
=> 0
irb> checked
=> 2

Let me know if you do not understand the code, I will try to simplify and
explain it. Also, let me know if you do not know what irb is.

Zeljko
--
ZeljkoFilipin.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to