Results 1 to 2 of 2

Thread: how to set focus to text box?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Posts
    41

    Question 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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width