Encountered an issue while utilizing this in our asp.net application.
The main goal is as follows:
- When in a textbox -> tab once MaxLength is reached
- When in a checkbox -> tab once the control is toggled with the keyboard (spacebar)
Other than buttons, these are the only controls on the form. The functionality is toggled by the end user (saved using a cookie).
Challenges:
It seems to go through the process quite randomly. Sometimes it performs quickly, sometimes it doesn't. The form is currently set with a large tab index range that will likely remain. Not a major concern, but any tips would be appreciated.
The checkbox functionality is behaving oddly. For instance, when toggling CheckBoxA using the keyboard, it appears disabled and then focuses on CheckBoxB. Clicking anywhere on the page after this toggles CheckBoxA continuously, ignoring normal mouse actions until a right-click and dialog dismisses the context menu which is not ideal. This erratic behavior also affects CheckBoxB.
The important code for the function is provided below. CheckCookie() ensures that AutoTab is set before proceeding. Array.contains checks if the entered keycode is present in the array.
function test(input, inputClientID, e) {
// Code here
}
Tabbing is managed using a sort function presented below:
function tabNextCtrl(input) {
// Code here
}
Apologies for the length, but any help with this issue would be greatly appreciated.
Thank you,