简体   繁体   中英

Jquery validation custom validator firing too often

I have written a custom validator function for the jquery validation module. It works correctly and performa the correct validation.

When you submit the form for the first time tbe validation function is called once on the submit. However once the form has discovered errors it appears to call the custom validation function (and the built in ones) on every keystroke. How can I prevent this on my custom validator? I only want it to be called when the user next clicks submit and not when they type in the corresponding text field

Thanks a lot for your help

It is a little bit hidden in the documentation

See http://validation.bassistance.de/validate/ - onkeyup

Example: Disables onkeyup validation.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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