954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Something like google

I am designing a search engine and I want to design it in a way that when user comes to the website the cursor should be already on the search bar. Right now the user needs to hit a tab or manually initiate cursor into the search bar. Any ideas how I can do that?

s0bigg
Newbie Poster
23 posts since Aug 2011
Reputation Points: 10
Solved Threads: 1
 

in a page load event, write YourTextbox.Focus() in !isNotPostback code block.

[This is for Asp.Net C#, please see other syntax for VB.Net]

sufyan2011
Junior Poster
166 posts since Dec 2011
Reputation Points: 9
Solved Threads: 20
 

To implement it in JavaScript please see following example:

http://diovo.com/2009/04/javascript-better-way-to-set-focus-in-page-load/

sufyan2011
Junior Poster
166 posts since Dec 2011
Reputation Points: 9
Solved Threads: 20
 

Thanks! It worked..

s0bigg
Newbie Poster
23 posts since Aug 2011
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: