I am trying to use the focusout function ( http://api.jquery.com/focusout/ ) in jQuery to execute the function after the user is distracted from the input form field, but it does not work.
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 the other plugin I am using (qtip) gives me an error when I try to use jquery-1.4.2.min.js.
How can I make a focus event, or is there another way to do what I'm trying to accomplish?
source share