Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus to textbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00689308
Message ID:
00689403
Vues:
22
>I have several ASPs that have forms that contain phone numbers in the 3 textbox format.
>ie:
>txtAreaCode txtExchange txtFourDigits
>
>My users have to tab out of each textbox to keyboard an entire phone number. Do you have any suggestions on how to have the focus set to the next textbox when a user completes the entry in the preceeding textbox?

Here's something that might get you started... there may be a better way, I was just knocking around with this.
<SCRIPT LANGUAGE="JavaScript">

function checklength(input,nlen,cgoto) {
if (input.value.length == nlen) {
 eval('thisform.'+cgoto+'.focus()');
}
}

function resetval(input) {
input.value = '';
input.focus();
}

</SCRIPT>
<html>

<body>

<form name=thisform>
<input type = text size=3 name=three maxlength=3 onfocus=resetval(this); onkeydown=checklength(this,3,'four');>
<input type=text size=3 name=four>
</form>
</body>
</html>
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform