More in this section

Forums / General Discussions / How to add default text to a search box

How to add default text to a search box

5 posts, 0 answered
  1. Viktoriya
    Viktoriya avatar
    20 posts
    Registered:
    29 Jul 2010
    02 Aug 2010
    Link to this post
    Hi,

    I'm new to Sitefinity and was wondering if anyone can help me. I'm trying to set a default text for a search box on a site that I'm working on...

    How can I do this?

    Our version of Sitefinity is 3.7.2022.5

    Thanks in advance!
    Viktoriya Mancheva
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    02 Aug 2010
    Link to this post
    Hello Viktoriya,

    Thank you for using our services.

    Please open your website in Visual Studio and go to ~/Sitefinity/ControlTemplates/Search/SearchBox.ascx. Then set the test of the text box with ID=queryText.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Viktoriya
    Viktoriya avatar
    20 posts
    Registered:
    29 Jul 2010
    02 Aug 2010
    Link to this post
    Hi Radoslave,

    Thanks for the prompt reply but I'm trying to include a default text within the actual search box. Similar to how the search on telerik's site works i.e. the user clicks within the search box and the text 'Search Site' disappears...

    Thanks,
    Viktoriya
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    02 Aug 2010
    Link to this post
    Hello Viktoriya,

    Since the regular ASP.NET TextBox which we use does not support this out of the box you will have to take an approach similar to the one explained in this blog post (exclude the required field validation part): ASP.NET HowTo: including default text in a Textbox while enforcing server-side validation.

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Viktoriya
    Viktoriya avatar
    20 posts
    Registered:
    29 Jul 2010
    02 Aug 2010
    Link to this post
    Thanks for the reply and link, Radoslave! Hope this feature to be included in future.:)
    Viktoriya
Register for webinar
5 posts, 0 answered