jQuery Validator — only validate onblur event (not onchange)

前端 未结 2 1171
[愿得一人]
[愿得一人] 2021-01-19 02:43

I\'m using the jQuery validator and would like to validate certain elements when certain events occur.

For example: some textboxes should only validate onblur, where

相关标签:
2条回答
  • 2021-01-19 03:05

    Like this:

      $('form').validate({
        onfocusout: function(e) {
          this.element(e);
        }
        , onkeyup: false
      });
    
    0 讨论(0)
  • 2021-01-19 03:13

    Maybe something like this?

    $("#element").blur(function(){
       $(this).validate({
          // your code here
       })
    })
    
    0 讨论(0)
提交回复
热议问题