jQuery验证,不检查键入 [英] jQuery validate, don't check on keyup

查看:102
本文介绍了jQuery验证,不检查键入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我有一个使用 jQuery验证插件的自定义规则的自定义回调设置发出AJAX请求并返回布尔结果.第一次尝试可以正常工作,因此,如果无效,则显示错误.之后的任何尝试都会触发自定义回调,从而导致多个AJAX调用,每个keyup事件一个.是否有任何方法可以仅针对此字段禁用对每个按键的自定义回调的自动触发?

Right now I have a custom callback setup for a custom rule using the jQuery Validation Plugin that makes an AJAX request and returns the boolean result. This works fine for the first attempt, so if it is invalid, it displays the error. Any attempt after that is firing the custom callback which leads to multiple AJAX calls, one for each keyup event. Is there any way to disable the automatic firing of the custom callback on every keyup, just for this field?

推荐答案

有一个选项.请参见此处.

禁用onkeyup验证.

Disables onkeyup validation.

$(".selector").validate({
   onkeyup: false
});

这篇关于jQuery验证,不检查键入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆