Rails input 框回车提交表单

sforce100 · December 10, 2012 · Last by ihlayy replied at December 11, 2012 · 2859 hits

用的是 simple_form_for 不是说有多个 input type="text",按回车就不会提交吗??? 怎么说话不算话呢

..你从哪知道的。我知道的是如果你的 input 在 form 表单内,回车,肯定是会被提交的。

你要回车不想提交。不放到 form 内,或者直接在 input 上写个 class = "noautosubmit" , 用 jquery 把回车的事件过滤掉

You need to Sign in before reply, if you don't have an account, please Sign up first.