Select-all checkboxes in a FORM_TAG

Posted by Horace Ho on Stack Overflow See other posts from Stack Overflow or by Horace Ho
Published on 2010-06-13T05:13:21Z Indexed on 2010/06/13 8:12 UTC
Read the original article Hit count: 180

Filed under:
|
|

In a form_tag, there is a list of 10 to 15 checkboxes:

<%= check_box_tag 'vehicles[]', car.id %>

How can I select-all (put a tick in every single) checkboxes by RJS? Thanks

EDIT: Sorry I didn't make my question clear. What I meant to ask is how to add a "Select/Un-select All" link in the same page to toggle the checkboxes.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about ruby-on-rails