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="frmdatebo xes" action="test2.a sp" method="post">
<input type="hidden" name="hidBBdate " value="">
<input type="text" name="txtmonth" class="smalltxt box" maxlength="2"
onKeyPress="che cklen(this,2);" > /
<input type="text" name="txtday" class="smalltxt box" maxlength="2"
onKeyPress="che cklen(this,2);" > /
<input type="text" name="txtyear" class="txtbox" maxlength="4"
onKeyPress="che cklen(this,4);" >
</form>
function checklen(tFormO bj, tLen)
{
if (tFormObj.value .length == tLen)
{
document.forms["frmdatebox es"].nextelement.fo cus();
}
}
TIA
-Bruce Duncan
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="frmdatebo xes" action="test2.a sp" method="post">
<input type="hidden" name="hidBBdate " value="">
<input type="text" name="txtmonth" class="smalltxt box" maxlength="2"
onKeyPress="che cklen(this,2);" > /
<input type="text" name="txtday" class="smalltxt box" maxlength="2"
onKeyPress="che cklen(this,2);" > /
<input type="text" name="txtyear" class="txtbox" maxlength="4"
onKeyPress="che cklen(this,4);" >
</form>
function checklen(tFormO bj, tLen)
{
if (tFormObj.value .length == tLen)
{
document.forms["frmdatebox es"].nextelement.fo cus();
}
}
TIA
-Bruce Duncan
Comment