Friday, March 22, 2013

SharePoint 2013 Search: Forcing Focus on the Search Box

As a user navigates through your SharePoint Search Center, the page does not focus on any particular control or item on the page:

 
In order to enter or change the search words, the user must click within the search box first. However, I stumbled upon a setting within the Search Box web part (also exists in the People Search Box web part) that will make the search box have focus when the page is loaded. Ironically, the settings is called "Make the search box have focus when the page is loaded".
 
To enable this feature, edit a search results page that contains a search box. From the Search Box drop-down select Edit Web Part:
 

 
 
In the Search Box Web Part properties tool pane, scroll down and expand the Settings section. At the bottom of the section you'll see the option:
 


Simply check the checkbox and click OK. Check in and publish your results page. Now when the page is rendered, the focus is on the Search Box and the cursor appears accordingly.Sometimes the smallest things are the coolest!

 

5 comments:

  1. i want to achieve the similar facility using list view Webpart, When i enter two webpart the focus from the first webpart get lost can u please suggest some solution?

    ReplyDelete
    Replies
    1. I would try to place some javascript on the page that sets focus to the Web part you want.

      Delete
    2. I would try to place some javascript on the page that sets focus to the Web part you want.

      Delete
  2. Thanks! At first I wrote JavaScript to obtain this, but eventually reverted to this easy option.

    ReplyDelete

Matched Content