<% 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 %>
---
Note that whenever I insert the javascript like above, it prechecks the box on the screen but doesn't submit any info to the URL. If I click the submit button, everything works great, but "onclick" I can't get the URL to budge.以上就是Checkboxes patently refuse to submit information onclick- HELP的详细内容,更多请关注web前端其它相关文章!
未经允许不得转载:web前端首页 » JavaScript 答疑