简体   繁体   English

为什么HTML表单输入会自动被禁用?

[英]Why do html form inputs automatically get disabled?

I am using the RightJS javascript framework. 我正在使用RightJS javascript框架。 I'm not sure if that has anything to do with this behavior or not. 我不确定这是否与这种行为有关。 I have a form on my page and I use $('some_form').send(); 我的页面上有一个表单,并且使用$('some_form').send(); to send the form to the server via a Post. 通过邮政将表格发送到服务器。 The form submission works fine and request goes through to the server without error but after all the inputs in the form become disabled. 表单提交工作正常,请求毫无错误地传递到服务器,但是在表单中的所有输入都被禁用之后。 Does anyone know what might be causing this to happen? 有谁知道可能导致这种情况发生的原因?

You need to run the preventDefault() function 您需要运行preventDefault()函数

$('form').send({
  spinner:    $('spinner'),
  onComplete: preventDefault()
});

Its a jQuery feature 它的jQuery功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM