Sohel Rana
Sohel Rana

Reputation: 1

move cursor automatically from on numeric input field to next field

I have two html input[type=number] fields. Each field contain 2 digit numeric velue. After entering 2 digit, I want to move the cursor to the next field automatically. How can I do this with Jquery or javaScript.

Upvotes: 0

Views: 379

Answers (1)

Mesar ali
Mesar ali

Reputation: 1898

You can check length of input of first textbox inside keyup event, then if length equals 2, focus on second input box as.

document.getElementById("id_of_second_textbox").focus();

Upvotes: 1

Related Questions