Skip to content

Instantly share code, notes, and snippets.

@casaval
Created August 19, 2013 22:01
Show Gist options
  • Save casaval/6274691 to your computer and use it in GitHub Desktop.
Save casaval/6274691 to your computer and use it in GitHub Desktop.
Parsely.js add server side error checks on submit
$(this.content).find("form").parsley('addListener',{
onFormSubmit:function(isFormValid, event, parsleyForm){
event.preventDefault();
if(isFormValid) {
$.post('/video/vote', parsleyForm.$element.serialize(), function(data) {
if(data.message === 'success') {
} else {
}
console.log('message: ' + data.message);
});
}
return false;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment