I have the following javascript that checks the length of a value of a form field against the maxlength value, and when it is reached, pushes the focus out of the input into the next one specified. This works as expected.
Code: Select all
function tabOut( thisField, nextField )
{
if (thisField.getAttribute)
{
if ((thisField.nodeName.toLowerCase() == "input" && thisField.value.length == thisField.getAttribute("maxlength")) || thisField.nodeName.toLowerCase() == "select")
{
document.getElementById(nextField).focus();
}
}
}Can someone please help me figure this out? As always, your help is much appreciated.