jquery.validation 需要不停止回发
我正在使用 jQuery 验证来尝试阻止用户回发,除非他满足几个条件。但所需的选项似乎并没有阻止表单提交...
这是 jsFiddle 的示例: jsFiddle
我仔细检查了我的 jQuery 代码,看起来好像它正在工作。 jsFiddle 说它是有效的代码。所以我不确定挂断是什么?
谢谢
I am using jQuery validation to attempt to keep a user from posting back unless he meets a couple of qualifications. But the required option doesn't seem to be keeping the form from submitting...
Here is jsFiddle with an example: jsFiddle
I double checked my jQuery code and it would seem as though it was working. jsFiddle says it valid code. So I am not sure what the hangup is?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jQuery.validate 使用规则名称,而不是 id。因此,请将输入字段中的 id 替换为名称。
此外,您的表单应为
这是您的固定代码的链接:
和脚本:
jQuery.validate uses names for the rules, not ids. So replace the ids with names in your input fields.
Also your form should be
<form id="temp1">
and not<form id="#temp">
.Here's a link to your fixed code:
and the script: