I have a textbox and button to check items in the database. The thing is I want to trigger the button click event when textbox is lost focus. This is my click event.
$(document).ready(function() { $("#button_from").click(function() { $("#waitingFrom").show(); $.ajax({ type: 'POST', url: 'index.php?m=item&a=getPartName', dataType: 'json', data: { part_no: $("#from_part_no").val() }, success: function(data) { $("#waitingFrom").hide(); $("#tfrom_part_name").val($("#from_part_name").val (data.DESCRIPTION).val()); $("#tfrom_status").val($("#from_status").val (data.INVENTORY_ITEM_STATUS_CODE).val()); $("#tfrom_inventory").val($("#from_inventory").val (data.TRANSACTION_QUANTITY).val()); $("#tfrom_usage_rate").val($("#from_usage_rate").val (data.USAGE_RATE).val()); } }); }); I need help to call that click event when let's say $("#from_part_no") has lost focus. Thanks in advance.