There are multiple ways to set the default value in small search input box depending of the scope. Approaches are described below:
Farm Level
If you want to change the default text in Farm level follow the steps,
- Open the file in notepad.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\OSearchBasicFeature\SearchArea.xml
- Add the below property within the <Control> node.
- <Property Name="QueryPromptString"> [Your Default Search Text] </Property>
Here [Your Default Search Text] is the text you want to show in the search box.
- Open the file in notepad.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\OSearchEnhancedFeature\SearchArea.xml
- Add the below property within the <Control> node.
- <Property Name="QueryPromptString"> [Your Default Search Text] </Property>
Here [Your Default Search Text] is the text you want to show in the search box.
Web Application/Site Collection/Site Level
If you want to change the default text for Web Application/Site Collection/Site (Web) level follow the below steps,
- Create a blank SharePoint project and add an “Empty Element” within it.
- Add the below code within the <Elements> node.
- <Control
- Id="SmallSearchInputBox"
- Sequence="10"
- ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx"ControlAssembly="Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
- <Property Name="GoImageUrl">/_layouts/images/gosearch15.png</Property>
- <Property Name="GoImageUrlRTL">/_layouts/images/gosearchrtl15.png</Property>
- <Property Name="GoImageActiveUrl">/_layouts/images/gosearchhover15.png</Property>
- <Property Name="GoImageActiveUrlRTL">/_layouts/images/gosearchrtlhover15.png</Property>
- <Property Name="DropDownMode">ShowDD</Property>
- <Property Name="SearchResultPageURL">/_layouts/osssearchresults.aspx</Property>
- <Property Name="ScopeDisplayGroupName"></Property>
- <Property Name="FrameType">None</Property>
- <Property Name="QueryPromptString">[Your Default Search Text]</Property>
- </Control>
Note: sequence number must be smaller than the default one (default is set to 50).
- Define the scope of the feature which deploy this Empty Element. Depending on the feature’s scope the Default Text would set.