use an onclick for a button or something and send the form thru this
function checkAll(theForm) {
var z = 0;
while (theForm[z].type == ''checkbox'' ) {
theForm[z].checked = true;
z++;
}
}
adam
On 2/5/06, Jay <jay@here.com> wrote:> Hello!
>
> I have this page where I list all users in a table. There is checkbox in
> every row. My User-model has a "checked"-attribute.
>
> I have implemented the checkboxes like this:
> <%= check_box("user[]", "checked") %>
>
> Which outputs this:
> <input id="user_12_checked" name="user[12][checked]"
type="checkbox"
> value="1" /><input name="user[12][checked]"
type="hidden" value="0" />
>
> How can i check/uncheck all checkboxes in one click? Do I have to use
> javascript and have onClick()-event?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>