Click to See Complete Forum and Search --> : Tab to next field when maximum length is reached


meribinks
February 10th, 2001, 01:40 AM
I need to write a code to tab to the next field when the maxLength value is reached. I tried this code on the onkeydown event of the body..

if (event.srcElement.value.length == event.srcElement.maxLength)
{
event.srcElement.blur();
tabToNextField(event.srcElement); //my function
}
}
catch (e) {}

it is working, however there is a conflict when the field is selected and the maximum length is reached at the same time. it should not tab to the next field but delete the value. i can't find a function to check whether the field is selected or not.