Skip to content

Instantly share code, notes, and snippets.

@khoand0000
Created November 9, 2015 23:48
Show Gist options
  • Save khoand0000/c3db7a21755c738d5ab5 to your computer and use it in GitHub Desktop.
Save khoand0000/c3db7a21755c738d5ab5 to your computer and use it in GitHub Desktop.
Prevent Parsley double submitting when using javascript to initializing

click submit form A, form is valid: form A trigger submit event (1st time) --> form:submit event will be triggered --> Parsley make form A submit again (2rd time).

window.Parsley.on('form:submit', function (instance) {
    instance.submitEvent.preventDefault();
    return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment