1
votes

I have found this jQuery validator. I use a jQuery code to submit the form once.

The validation works perfect. When an input field is not correct and I press the Submit button it gives an error and won't submit.

Then I will change the input correctly and the form won't submit.

Validate: $.validate();

Submit once

$("#form").submit(function() {
    $(this).submit(function() {
        return false;
    });
    return true;
});
1
When you submit the form and return false; you're instructing the form to not submit. - kyle.stearns

1 Answers

0
votes

The following snippet causes the form to not submit:

$(this).submit(function() {
   return false;
});

Try this:

$('#form').validate();