How to perform validation on submit only - jQuery Validation plugin

后端 未结 2 1414
面向向阳花
面向向阳花 2021-01-03 01:14

I want the jQuery Validate plugin to only display the validation messages only upon form submit and not when the focus from a input field is lost. How do Ii achieve this?

2条回答
  •  Happy的楠姐
    2021-01-03 01:21

    You have to change the default option for onfocusout

    $(".selector").validate({
       onfocusout: false
    })
    

    More options to enable or disable are listed here - http://docs.jquery.com/Plugins/Validation/validate#toptions

提交回复
热议问题