I have OOB sharepoint application. This has got the search enabled. I would like to give the default text for the search text box. So, I have given the following code in the Elements.xml file of SmallSearchInputBox Delegatecontrol. But still I dont see any default text in the search box. Please help me to fix this.Here is the code.

<?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
       ControlAssembly="Microsoft.Office.Server.Search, Version=, 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_NoContextual</Property>
        <Property Name="ScopeDisplayGroupName">Search Dropdown</Property>
        <Property Name="FrameType">None</Property>
        <Property Name="QueryPromptString">Search...</Property>
  • Are you deploying this as a feature? Did you activate the feature? What site template are you using? What is the Sequence property value set to? Here's an example of how to override the SmallSearchInputBox delegate control: blendmaster.net/blog/2012/06/… – Vassili Altynikov Apr 25 '13 at 15:23
  • Yes, I am deploying as a feature and I have activated that.Sequence Property value is 10. I am using the standard site template. – Ram Apr 25 '13 at 15:43
  • 1
    Seems like the issue is related to the ShowDD_NoContextual drop down mode. SharePoint is not using the QueryPromptString property value in that case for some reason. – Vassili Altynikov Apr 25 '13 at 18:43
  • What could be problem with the ShowDD_NoContextual. I dont get any error or failure in functionality is happening due to this. – Ram Apr 26 '13 at 8:27
  • Could some one help me with this please? – Ram Apr 26 '13 at 11:18

I think the best way achieving your goal is by inserting your default text to search box using JavaScript/JQuery code.

Using JQuery:

var textBox = $('#searchBoxID');

Using JavaScript:

var textBox = document.getElementById("searchBoxID");
    textBox.value = "Search...";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.