Ajax-submit form on “check box onclick ”: why this error?

女生的网名这么多〃 提交于 2019-12-04 16:20:09

Seems you are abusing the remote_function helper. Its purpose is to generate the same javascript as is generated with link_to_remote et al., like, to update a div with the result of an AJAX call. In your case you need a simple thing like

<%= check_box_tag 'whatever', nil, whatever, { :onclick => "$('your_form').onsubmit();" } %>

Note the onsubmit, not submit. This is because the code you need to submit the form via AJAX is present in the onsubmit attribute of the form.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!