Jquery Field Validation Onblur (mvc)
I want to have the fields in my form be validated after the user clicks out of them. However, I am not familiar with client side validation using Jquery. Can anyone explain how to
Solution 1:
This can be achieved with JS
var accName = document.getElementById('txtAccountName');
accName.addEventListener('blur', function () {
if (accName.value != "") {
//do something
}
});
Updated Or in jQuery:
var accName = $("#txtAccountName");
accName.blur(function () {
if (accName.val() != "") {
//do something
}
});
Post a Comment for "Jquery Field Validation Onblur (mvc)"