I am trying to use the focusout(http://api.jquery.com/focusout/) function in jQuery, to perform a function after the user focus away from an input form field, but it's not working.
Here is my code:
$("#employee_id").focusout(function(){
var employeeId = $("#employee_id").val();
if(employeeId == '') {
$("#employee_id").after('<div class="error">Your employee id number is required.</div>');
hasError = true;
}
});
I am using jquery-1.3.2.min.js since another plugin I am using(qtip) is giving me an error when I try to use jquery-1.4.2.min.js.
How can I make the focusout event work, or is there another way to do what I am trying to accomplish?