I was hoping I could get some help with a problem I've been having. I would like to set a small delay when the user presses the TAB button before the next input field found on the webpage is selected. The reason for this is that I am using AJAX to build an order form field, with expandable and collapsible tables that will be taking input from the user.
I have it set up using onfocusout to call a function that expands the table below the current table the user is in after they leave the last field, and would like the first input field to be auto selected right after. Everything works as should when the user exits the last field of a table by clicking out of it, but when tabbing out of it I believe there is a problem because there is not a field to be tabbed to until after it retrieves the next table to display using AJAX.
I can provide code if needed, but I think I'm missing something, rather than having a mistake somewhere. Help would be appreciated, and I'd be more than happy to clarify anything that is unclear. Thank you!
So, I've created a very basic example of how this can work. My example only accounts for inputs, but you can play with the code to do what you need.
Warning: Preventing natural browser behavior can be tricky so pay attention to other issues this could cause.
Here is a Fiddle showing how you can do this: https://jsfiddle.net/iamjpg/wme339h9/
Good luck!