jQuery Validator — only validate onblur event (not onchange)

前端 未结 2 1173
[愿得一人]
[愿得一人] 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:13

    Maybe something like this?

    $("#element").blur(function(){
       $(this).validate({
          // your code here
       })
    })
    

提交回复
热议问题