1,105,208 Community Members

Something like google

Member Avatar
s0bigg
Light Poster
25 posts since Aug 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
sufyan2011
Junior Poster
165 posts since Dec 2011
Reputation Points: -1 [?]
Q&As Helped to Solve: 23 [?]
Skill Endorsements: 0 [?]
 
0
 

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]

Member Avatar
sufyan2011
Junior Poster
165 posts since Dec 2011
Reputation Points: -1 [?]
Q&As Helped to Solve: 23 [?]
Skill Endorsements: 0 [?]
 
0
 

To implement it in JavaScript please see following example:

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

Member Avatar
s0bigg
Light Poster
25 posts since Aug 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks! It worked..

Question Answered as of 2 Years Ago by sufyan2011
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: