Out of the Box Search Box Empty Text - General Discussions - General Discussions - Progress Community
 General Discussions

Out of the Box Search Box Empty Text

  • Out of the Box Search Box Empty Text
  • I would like to add something like "Enter Search Term Here" for the search box text when the page loads, much like the EmptyMessage feature of radtextbox.  Is there a way to easily do this with the out of the box search control? 
  • Thank You!  The MVC was the key and it looks great.  
  • 4dfc551e-37c1-6deb-a958-ff0000446526_searchbox-backgroundhint.png

    Hi James,

    For Search Box MVC widget, sitefinity has BackgroundHint setting (SearchBoxBackgroundHint image).  For old widget, SF doesnt have this setting, you can do that by modifying template of search box. You can do that on this way:

    1) Save this code as SearchBox.ascx

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" %>
    <sitefinity:ResourceLinks id="resourcesLinks" runat="server" UseEmbeddedThemes="True" UseBackendTheme="True">
        <sitefinity:ResourceFile JavaScriptLibrary="JQuery" />
        <sitefinity:ResourceFile JavaScriptLibrary="KendoAll" />
    <%--    <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_common_min.css" Static="true" />
        <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_default_min.css" Static="true" />
        <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Scripts.Kendo.styles.kendo_mobile_all_min.css" Static="true" />--%>
    <fieldset id="main" class="sfsearchBox" runat="server">
        <asp:TextBox ID="searchTextBox" runat="server" CssClass="sfsearchTxt" />
        <asp:Button  id="searchButton" runat="server" Text="<%$Resources:SearchResources, Search %>" OnClientClick="return false;" CssClass="sfsearchSubmit" />

    2) Place it inside of your project

    3) Edit this template and put any placeholder

    4) Go to widget settings of "Search Box" widget and change LayoutTemplatePath to the new path