When you use Parsley.remote.js, two new methods are available: asyncValidate()
and asyncIsValid()
that returns promises.
Parsley.remote.js auto-bind asyncValidate()
on data-parsley-trigger
events and on form submit.
If you want to manually control parsley on form submit via javascript, please use this:
var parsleyForm = $('#userPanel').parsley();
$("#saveNewUser").click(function () {
parsleyForm.asyncValidate()
.done(function () { console.log('success'); })
.fail(function () { console.log('there is an error'); })
.always(function () { console.log('done everytime whatever happens'); });
}