I have this code to validate if a field is empty or not. It is binded into the blur event of a input with an anonymous function.
isValidText = function(){
if ($(this).val().trim() == ""){
//some code here
return false;
}
//some code here
return true;
}
$("#someElement").blur(isValidText);
At a certain point, I want to get the returning value from the binded function doing something like this:
//this return a jQuery object
var isValid = $("#someElement").blur();
//but I want the boolean from the isValidText
This is not possible because the blur() method return a jQuery object and not the return value of the isValidText function.
My question here is if there is a way to get the return value from the isValidText binded inside the blur event.
OR