Hi Guys, I have the following function for the jquery 'focusout' action. I'd like to bind both focusout AND keyUp to this function.
Is there a way to do this without basically writing each function twice?
Is there a way to do this without basically writing each function twice?
Code:
$('#registerFirstName').focusout(function(){
var checkregisterFirstName=$(this).val();
if(checkregisterFirstName == ''){
$registerFirstName.addClass("error");
$('#registerFirstNameBlankError').show();
}
else {
$registerFirstName.removeClass("error");
$('#registerFirstNameBlankError').hide();
}
});