Based on Parsley Js documentation, it is not clear when to return false when there is a validation error. How is that possible to prevent form from submitting when there is a form error?
$(function () {
$('#demo-form').parsley().on('field:validated', function() {
var ok = $('.parsley-error').length === 0;
$('.bs-callout-info').toggleClass('hidden', !ok);
$('.bs-callout-warning').toggleClass('hidden', ok);
})
.on('form:submit', function() {
return false; // Don't submit form for this demo
});
});