JavaScript code to stop form submission

前端 未结 12 2061
感情败类
感情败类 2020-11-21 06:40

One way to stop form submission is to return false from your JavaScript function.

When the submit button is clicked, a validation function is called. I have a case i

12条回答
  •  悲&欢浪女
    2020-11-21 06:50

    Simply do it....

    and here goes your JQuery

    $(document).on('submit', 'form', function(e){
        e.preventDefault();
        //your code goes here
        //100% works
        return;
    });
    

提交回复
热议问题