Created
October 10, 2015 14:52
-
-
Save Dinamiko/609ff9c0c4faa174d500 to your computer and use it in GitHub Desktop.
This file contains 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
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