I know this should be simple...but for some reason my brain isn't working.
I want my users to enter a the date in three seperate boxes. After the
users enters in two digits for the month I want the cursor to move to the
day textbox and so on....
I was using simple code...but onKeyPress occurs before the value
changes...can anyone help me?
my code:
<form name="frmdateboxes" action="test2.asp" method="post">
<input type="hidden" name="hidBBdate" value="">
<input type="text" name="txtmonth" class="smalltxtbox" maxlength="2"
onKeyPress="checklen(this,2);"> /
<input type="text" name="txtday" class="smalltxtbox" maxlength="2"
onKeyPress="checklen(this,2);"> /
<input type="text" name="txtyear" class="txtbox" maxlength="4"
onKeyPress="checklen(this,4);">
</form>
function checklen(tFormObj, tLen)
{
if (tFormObj.value.length == tLen)
{
document.forms["frmdateboxes"].nextelement.focus();
}
}
TIA
-Bruce Duncan