rvelagaleti
rvelagaleti

Reputation: 51

Cursor on Tab - Javascript - Immediate field

I have to modify an existing html / javascript code to move the cursor to immediately next field.

Here is the order of fields

Textbox 1
Textbox 2
Datebox 1
List 1
Textbox 3

When I enter the text in Textbox 2 and press tab, the cursor goes to Textbox 3.

I believe this is how it works by default. Is there a way we can control it using an HTML tag or something to make the cursor go to the field that's immediately after Textbox 2?

Upvotes: 0

Views: 573

Answers (1)

marcus erronius
marcus erronius

Reputation: 3693

You want the tabindex attribute. Set each element's tab index to a value corresponding to the order in which you want the user to cycle through them.

Upvotes: 2

Related Questions