JQuery form validation

后端 未结 4 1566
梦毁少年i
梦毁少年i 2020-12-19 17:05

well my problem is that, i have a form, which i want to validate the fields using jquery, if the data is correct i let the submit continue, if no i disable the default behav

4条回答
  •  温柔的废话
    2020-12-19 17:51

    Since you said you are using a form, you could bind to the form's submit event:

    $('form#id').submit(function(){
      // your validation code
    });
    

提交回复
热议问题