2 Replies - 964 Views - Last Post: 15 April 2013 - 05:24 AM Rate Topic: -----

#1 superkb10  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 298
  • Joined: 27-November 11

Set Selected Element

Posted 13 April 2013 - 08:16 AM

Hi, I'm writing a website that will have the user filling out a textbox. Is it possible to have the textbox selected as soon as a button is pressed, because the textbox won't be visible until that button is pressed. I'm not sure whether this would be done through javascript, or C#. I've looked on the internet but all I've gotten is how to get a certain item selected in dropbox. Any help would be greatly appreciated, thanks!

This post has been edited by superkb10: 13 April 2013 - 08:16 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Set Selected Element

#2 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 280
  • View blog
  • Posts: 1,487
  • Joined: 07-April 08

Re: Set Selected Element

Posted 13 April 2013 - 09:34 PM

you would use Javascript and use the .focus() to do as you wish.
Was This Post Helpful? 0
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 445
  • View blog
  • Posts: 1,501
  • Joined: 28-April 09

Re: Set Selected Element

Posted 15 April 2013 - 05:24 AM

If you're wanting to do this from server side TextBox controls also have a Focus method which can be called to set focus to that control.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1