ruby on rails: submit a form clicking a check_box using JQuery -
i have form. added jquery onchange submit number_field tag. same want check_box_tag. want form submitted if click on 1 checkbox. tried many options don't it. hope can me.
<%= form_tag("/rooms/list", method: "get", :name => "list", :remote => true) %> <%= label_tag(:size, "gewünschte raumgröße:") %> <%= number_field(:room, :size, in: 0.0..999999999, step: 1.0, :value => @size, :onchange => ("javascript: document.list.submit();")) %> <br> equipment <br> <% @categories.each |category| %> <%= check_box_tag(category, {:remote => true, :onclick => ("javascript: document.list.submit();")}) %> <%= label_tag(category, category) %> <% end %> <% end %>
i got it!
<%= check_box_tag(category,true, false, :onclick => "javascript: document.list.submit();") %>
Comments
Post a Comment