HazardBoy Posted April 3, 2014 Posted April 3, 2014 (edited) Hello guys, I have a frustrating problem. I want to stop the caret from changing input focus (jump outside) when I press tab. Instead remain in the input field. Basically I want to create an auto-complete word when I press tab. What I've tried something similar to this: <input type="text" onKeyUp="preventTab(e)" onKeyPress="preventTab(e)" onKeyDown="preventTab(e)"> <script> function preventTab(e){ e.preventDefault(); documentQuery(...).focus(); return false; } </script> All keys trigger this function except tab key. - Please delete the thread. The code worked on KeyDown, no idea why it didn't worked before. Edited April 3, 2014 by HazardBoy Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.