This topic is locked
[SOLVED]

 Few seconds delay before record saved

9/18/2018 5:05:31 PM
PHPRunner General questions
M
Mr Foxx author

I am using a barcode scanner to enter a student ID into the system for class attendance tracking,

I already read a very useful post on having the SAVE button automatically clicked once the barcode is entered by using some Javascript onload event of Add/Edit pages:
$(document).keyup(function(e) {

if (e.keyCode == 13)

{

$("#saveButton1").trigger('click');

}

});
Thanks to Sergey Kornilov for that solution

I would like a few seconds delay before the save button is automatically clicked so some data can be viewed on the screen before being saved.

For example the student info can be viewed briefly before saving and getting ready to accept the next input.
Thanks again for the support.

admin 9/21/2018

Try this. It will delay for two seconds before clicking the Save button.

$(document).keyup(function(e) {

if (e.keyCode == 13)

{

setTimeout('$("#saveButton1").trigger("click");', 2000);

}

});
M
Mr Foxx author 9/24/2018

Thanks a million that seems to have done the trick.