B
BillKi
I am trying to use nextSibling to move focus to the next input (text
box).
Here's the script:
function CheckFieldLength(e, i)
{
// don't move automatically forward if a tab or shift-tab was just
entered
if (!(e.keyCode == 16 || e.keyCode == 9))
{
if(i.value.length == 4 )
{
if(i.nextSibling != null)
i.nextSibling.focus();
}
}
}
And here's the call
<input name="text1" size="4" type="text" maxlength="4"
onkeyup="CheckFieldLength(event, this);" />
After entering 4 chars, I get a Javascript error that says
object doesn't support this property or method.
Where am I going wrong? Thanks
box).
Here's the script:
function CheckFieldLength(e, i)
{
// don't move automatically forward if a tab or shift-tab was just
entered
if (!(e.keyCode == 16 || e.keyCode == 9))
{
if(i.value.length == 4 )
{
if(i.nextSibling != null)
i.nextSibling.focus();
}
}
}
And here's the call
<input name="text1" size="4" type="text" maxlength="4"
onkeyup="CheckFieldLength(event, this);" />
After entering 4 chars, I get a Javascript error that says
object doesn't support this property or method.
Where am I going wrong? Thanks