Hi this is my second post (and second week programming, ever) so apologies in advance.
I have a list of checkboxes that represent different search filters that I want passed to params. For example, if this were a restaurant search, I would want my users to be able to check off different types of cuisine that they are interested in. Just like Yelp.
All I want to do is to send the new parameters each time someone clicks on an option. I DON'T care about AJAX right now (I'll cross that bridge when I come to it).
CODE: (UPDATED FOR TYPO)
<% form_tag(hotels_path, :method => "GET", :id => :cuisine_form ) do %>
<%= check_box_tag('my_cuisine', 'Mexican', :onclick => "document.cuisine_form.submit();" ) %>
<%= label_tag(:my_cuisine, "Mexican", :onclick => "document.cuisine_form.submit();" ) %>
<%= check_box_tag('my_cuisine', 'Delis') %>
<%= label_tag(:my_cuisine, "Delis") %>
<%= submit_tag 'update' %>
<% end %>
以上就是Checkboxes patently refuse to submit information onclick- HELP的详细内容，更多请关注web前端其它相关文章！