javascript textbox focus to another when fixed length finished

Posted by Vanchi050585 under JavaScript on 7/26/2010 | Views : 2264 | Status : [Member] | Replies : 2
Hi friends,
i have three textboxes for date format(dd/mm/yyyy) in asp.net . i need 1st textbox should allow two character(dd), 2nd textbox also should allow two character(mm), and 3rd textbox should allow four character(yyyy). when i typed the 2 character in textbox1 the cursor should move to another.

Thanks
Vanchi

Thanks
tvn



Responses

Posted by: Muhilan on: 7/26/2010 [Member] Starter

Up
0
Down
you can use KeyPress Event to check whether the Textbox.value.length then focus to another control


Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 7/27/2010 [Member] Bronze

Up
0
Down
You can use jQuery for it.

KeyPress Event:
http://api.jquery.com/keypress/

To Validate Length:
http://stackoverflow.com/questions/815146/how-can-i-get-the-length-of-text-entered-in-a-textbox-using-jquery

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response