我通过下面的代码从下拉列表中提交一个国家/地区:-
<%=select_tag(:main, options_for_select(eval(forum.continent)), :prompt => "Select Country", :onchange => 'this.form.submit();')%>
我想以新的形式使用这里捕获的值,我该怎么做?
如果你使用jQuery,你应该得到表单并像这样提交:
<%=select_tag(:main, options_for_select(eval(forum.continent)), :prompt => "Select Country", :onchange => '$(this).closest("form").submit();')%>