Click to See Complete Forum and Search --> : Ignoring the TAB key


furma
10-22-2005, 08:04 AM
I wrote a script that runs under the 'onkeyup' event on an inputbox and counts how many characters have been written in the inputbox.
If the number of characters is higher than X, it automatically moves to the next inputbox using the select() function.

I have a problem when I press on TAB and the next inputbox already contains X characters, it automatically moves it to the next next inputbox.
I need the 'onkeyup' event to ignore the TAB key.
How do you do that?

Lerura
10-22-2005, 03:08 PM
use 'onChange' instead

konithomimo
10-22-2005, 03:14 PM
You need to set the multiline property on the textboxes and set TabStop to False on all controls on your form.

Kravvitz
10-22-2005, 03:48 PM
function keyHandler2(e) {
var key0;
if(e && e.which) {
key0 = e.which;
} else {
if(!e && window.event) e=window.event;
if(e && e.keyCode) {
key0 = e.keyCode;
}
}
if(key0 == 9) return; // don't do anything if the tab key is pressed
}

furma
10-22-2005, 04:17 PM
Thanks alot.
I did it the way Kravvitz suggested, and it worked.