Click here to Skip to main content
15,923,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i would like to focus password textbox when i press Enter Key in username textBox
in asp.net?
Posted
Comments
thatraja 20-Sep-10 10:01am    
Hey man, see the sample code in my answer for your issue. I guess you didn't see the link

1 solution

Search engines are always your best friends. I got this one in Google Enter Key in ASP.NET - Complete Research[^]

Sample code
JavaScript
txtUsername.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + txtPassword.UniqueID + "').focus();return false;}} else {return true}; ");
 
Share this answer
 
v2
Comments
sankar guru 20-Sep-10 5:39am    
Thank U Raja
sankar guru 20-Sep-10 8:26am    
I know only tabindex ,i dont know control id but i want to set focus of that control is it possible?
ankitaverma 18-Jun-12 8:05am    
i dnt want to use JavaScript ..pls suggest me server side code..

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