Created
July 15, 2013 14:32
-
-
Save brenes/6000406 to your computer and use it in GitHub Desktop.
Funcion JS para loguear errores de Parsley
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('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