Remote attribute validation on blur in asp.net mvc 3
The bu开发者_如何学Pythonild in remote attribute in asp.net mvc 3 does the validation "onchange".
I want it to validate on blur, is there a way to custom it? or there is something else for doing so? I'm sure it's a very common need.You could set default values like this and disable validation when a key is pressed:
$.validator.setDefaults({ onkeyup: false });
Assuming you are using jQuery validation and not MS Ajax Validation in ASP.NET MVC 3, you would turn off onchange validation (technically its onKeyUp validation) by using this:
$(".selector").validate({
onkeyup: false
});
精彩评论