Created
September 21, 2011 15:36
-
-
Save bkono/1232401 to your computer and use it in GitHub Desktop.
Eager js validation with asp.net mvc 3
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
<script type="text/javascript"> | |
$(document).ready(function () { | |
var settngs = $.data($('form')[0], 'validator').settings; | |
settngs.onfocusout = function (element) { $(element).valid(); }; | |
}); | |
</script> | |
options: { // options structure passed to jQuery Validate's validate() method | |
errorClass: "input-validation-error", | |
errorElement: "span", | |
errorPlacement: $.proxy(onError, form), | |
invalidHandler: $.proxy(onErrors, form), | |
messages: {}, | |
rules: {}, | |
success: $.proxy(onSuccess, form), | |
onfocusout: function (element) { $(element).valid(); } | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment