setting focus to textbox

T

Tony Piperato

Hello,

Can someone tell me if/how I can set the focus to a textbox so when the page
loads the cursor is placed in the textbox and the user can just begin
typing?

Thanks.

Pip
 
V

Victor Garcia Aprea [MVP]

Hi Tony,

Its pretty simple, you just need to output some javascript from the
server-side to set the focus to the control you want, take a look at
javascript's focus function. If I remember right, ScottGu[1] has posted a
ppt with some tricks & tips (including the focus one).

[1] http://weblogs.asp.net/scottgu

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup

and not by private mail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top