how to set focus to text box?
i am learning .net. In asp.net i run a web form that has a username and password field. If i press submit button without entering the username the focus must go back to the username textbox and show a message that i have not entered a username.
pl help me,
sai abhiram bandhakavi.
Re: how to set focus to text box?
Use client side validation (javascript). Check for the value entered in the textbox, if it's "", then use the .focus() method on it, and return false to the submit button.