Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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/">
      <Control
       Id="SmallSearchInputBox"
       Sequence="10"
       ControlAssembly="Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
       ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx">
        <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>
      </Control>
    </Elements>
share|improve this question
    
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

1 Answer 1

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');
textBox.val("Search...");

Using JavaScript:

var textBox = document.getElementById("searchBoxID");
    textBox.value = "Search...";
share|improve this answer
    
Figured out this and able to fix this.Thanks All. –  Ram May 3 '13 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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