I have a bizform with a custom form control on it that retrieves the employee name and store number based off of the employee number. In addition, I have a javascript that runs when the employee number has been changed. This javascript will go and get the textbox value and put that value in a regular bizform field.
The problem that I am having is that after a new employee number has been entered the javascript will go get the store number textbox value before it gets updated with the current employee's information.
$("#NewCoWorkerNumber input").change(function () { var storeNumber = $(".StoreNumberForHiringStore").val(); $("#HiringStore input").val(storeNumber); });
Try using set timeout to give the server a second or 2 to return the data
setTimeout(function(){ storeNumber = $(".StoreNumberForHiringStore").val(); }, 1500);
Hello Deanna,
You can use focusout event of jquery instaed of change:
$("#NewCoWorkerNumber input").focusout(function () { var storeNumber = $(".StoreNumberForHiringStore").val(); $("#HiringStore input").val(storeNumber); });
Please, sign in to be able to submit a new answer.