Cheers :-)
-----Original Message-----
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 19:58
To: 'Struts Users Mailing List'
Subject: RE: [OT][JavaScript][Lazy] Product Rego number automatic
JavaScript focus shifting
function moveNext( field) {
switch( field) {
case "areacode" :
if( document.forms[0].areacode.value.toString().length == 3) {
document.forms[0].phoneExchange.focus();
}
break;
case "phoneExchange" :
if( document.forms[0].phoneExchange.value.toString().length == 3) {
document.forms[0].phoneNumber.focus();
}
break;
case "areacodeDay" :
if( document.forms[0].areacodeDay.value.toString().length == 3) {
document.forms[0].phoneExchangeDay.focus();
}
break;
case "phoneExchangeDay" :
if( document.forms[0].phoneExchangeDay.value.toString().length == 3)
{
document.forms[0].phoneNumberDay.focus();
}
break;
case "ssn1" :
if( document.forms[0].ssn1.value.toString().length == 3) {
document.forms[0].ssn2.focus();
}
break;
case "ssn2" :
if( document.forms[0].ssn2.value.toString().length == 2) {
document.forms[0].ssn3.focus();
}
break;
}
}
In the HTML, something like:
<html:text property="ssn1" size="2" maxlength="3" styleClass="inputText_3"
onkeyup="moveNext( 'ssn1')" />
-----Original Message-----
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 3:07 AM
<pleasedomyworkforme>
<excuse sin="sloth">
Doubtless their are tons on resources on the net but its Friday ,Im feeling
lazy, and Im sure many of you have already done this...
<excuse>
Ive got a product registration field on a form which consists in the html of
a few <input> fields.
I want the focus to shift automatically to the next field when the first is
completed.
Anyone out there already got a suitable JavaScript function I can set as one
of the onXXX handlers they could give me for this?
</pleasedomyworkforme>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>