javascriptparsley.js

Parsley.js skip validation on submit?


When I try to submit a form, either via an input[type=submit] or by calling form.submit(), Parsley validates the form and cancels the submission if invalid. Is there any way I can skip that validation since I'm manually calling validate on sections of my form?

Specifically what I'm trying to achieve is submitting partial versions of the form, so I validate a group and only that portion is sent to the server (even if the rest of the form is still not valid).


Solution

  • I you want to cancel Parsley default validation on submit event, you'll have to remove the submit.Parsley binded event on your form.

    Doing a $('#yourform').off('submit.Parsley'); should solve your issue.

    Best

    Edit: For Parsley2, since events names have changed, it should be $('#yourform').off('form:validate');