I am making a one-page application, which will be launched next week, for a rather huge client, and is going to live for a rather large event, and well, a ton remains.
There are 100+ "pages" that are loaded within a single window 700px x 600px, and I recently found out that you can contribute to the page / sections, which in turn will break the application, because this will lead to focus for hidden elements off-screen , so for this reason, I disabled the tab key for the entire application.
But now there are a couple of places where we have a form with several input fields that you cannot complete by filling out the form. This is a pain in the ass.
I need to make it so that you can insert form fields, but only form fields. I have the tabindex attribute set for the form and tried to enable the tab of the tabs, but could not get it to work without forcing the application to go to hidden sections.
Here is the function that I need to change in order to disable the tab key, except for entering the input fields in the form.
window.onkeydown = function(e) { if (e.keyCode === tab) { return false; } }
I tried to make it that obv did not work lol
$('input').keydown(function(e) { if (e.keyCode === tab) { return true; } });
Thanks:)
source share