move the cursor upon completion of the first 2 boxes.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

move the cursor upon completion of the first 2 boxes.

Post by mit »

Hi;Situation is like this;

I have 3 text field for entering serial number, first one ,2 digit , second one 4 digit and last one 5 digit.
I need after inserting 2 digits in first field ,cursor goes to second field and so on ... how can i do this?
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

Re: move the cursor upon completion of the first 2 boxes.

Post by mit »

I meant tab goes to other field after completing of each field.thx
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: move the cursor upon completion of the first 2 boxes.

Post by Christopher »

Please no double posting.

You can edit your own posts by clicking on the EDIT button at the lower right of the post.
(#10850)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: move the cursor upon completion of the first 2 boxes.

Post by requinix »

There's a property called "tabindex". First Google result got me this page.
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

Re: move the cursor upon completion of the first 2 boxes.

Post by mit »

when the current form element's maxlength has been reached. the user does not have to manually click in or tab to the next field and it goes by auto
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: move the cursor upon completion of the first 2 boxes.

Post by requinix »

So what did you mean when you said
mit wrote:I meant tab goes to other field after completing of each field.thx
Use JavaScript, the onchange event, the value property, and the .length property of strings to find out how long the input is. Then the .focus() method to change focus to the next field.
Post Reply