Skip to content

Instantly share code, notes, and snippets.

@brenes
Created July 15, 2013 14:32
Show Gist options
  • Save brenes/6000406 to your computer and use it in GitHub Desktop.
Save brenes/6000406 to your computer and use it in GitHub Desktop.
Funcion JS para loguear errores de Parsley
$('form').parsley( {
listeners: {
onFieldError: function ( elem, constraints, ParsleyField ) {
if (javascript_env == 'production') {
return;
}
_log("Errores: ")
_log(elem.attr("name") + ": " + elem.val());
for(constraint_id in constraints) {
if (constraints.hasOwnProperty(constraint_id)) {
_log(constraint_id + ": " + constraints[constraint_id].requirements);
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment