Skip to content

Instantly share code, notes, and snippets.

@Dinamiko
Created October 10, 2015 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dinamiko/609ff9c0c4faa174d500 to your computer and use it in GitHub Desktop.
Save Dinamiko/609ff9c0c4faa174d500 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($) {
var form = $( "#form-encuesta" );
jQuery.validator.setDefaults({
debug: false,
success: "valid"
});
jQuery.extend(jQuery.validator.messages, {
required: "<div style='margin-top:10px;margin-bottom:15px;width:100%;float:left;'>Campo obligatorio.</div>",
email: "Email incorrecto.",
});
form.validate({
success: function(label,element) {
$.validator.messages.required = '';
},
});
$( "#form-encuesta" ).submit(function(e) {
e.preventDefault();
if( form.valid() ) {
// ...
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment