got the following code that works great in IE, i have need an exception to these rules.
Why to Tab? Users come from old Apps (data entry people) and want to use the enter key to move through fields.
Works fantastic, however i have a text area now that they can't enter blank lines (paragraph breaks)
what is the best way to modify this so that my text areas are exceptions to this rule.
I do not want to have to call a function onKeyUp/Down of each input field, there's a lot and i will miss some in development. (besides, it's messy)
By the way, Firefox compalins about event on line 8 above as being not defined, does that need to be "e.keyCode = 9" ??
Thanks
Why to Tab? Users come from old Apps (data entry people) and want to use the enter key to move through fields.
Works fantastic, however i have a text area now that they can't enter blank lines (paragraph breaks)
Code:
document.onkeydown = checkKeycode
function checkKeycode(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
if(keycode == 13){
event.keyCode=9;
}
}
I do not want to have to call a function onKeyUp/Down of each input field, there's a lot and i will miss some in development. (besides, it's messy)
By the way, Firefox compalins about event on line 8 above as being not defined, does that need to be "e.keyCode = 9" ??
Thanks
Comment