Catch Client Side Validation failure

混江龙づ霸主 提交于 2020-01-03 16:51:10

问题


I've got a form that I'm submitting based on a div click. I also have it launching a waiting indicator when clicked. I'm trying to find out if there is a way to detect if client side validation failed or not so that I can remove the waiting indicator/never show it after a submit attempt...or can I call the the client side validation manually before I attempt the submit?


回答1:


you can try

$('div').click(function() {
    if ($('form').valid()) {
       //form is valid

    else{
          //invalid form 
    }
  }
});


来源:https://stackoverflow.com/questions/9120378/catch-client-side-validation-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!