Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

I have place three text boxes, for ex: text1,text2,text3

every text boxes has maxlength property as 3,

What i want is, when i enter 3 characters in the text1, it should switch to the text2 automatically.

Similarly from text2 to text3.

I don't how to implement in HTML in MVC.

Any Help will be appreciated

Thanks in advance
Posted

1 solution

MVC is irrelevant really, you do this with javascript. There's a onkeyup event on the input control, you can use that to check the length of input. I'd write a method that takes a textbox and the name of the control to go to next, then you can write code that checks the length and sets the focus to the id passed in when it is 3.
 
Share this answer
 
Comments
♥…ЯҠ…♥ 24-Jul-12 3:26am    
could you give me a sample script for the same?
Christian Graus 24-Jul-12 6:08am    
How about you, being a programmer, try to write it and then ask me for help if you get stuck ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900