Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Watermark text in search box View modes: 
User avatar
Member
Member
Armysniper89 - 9/7/2011 1:26:47 PM
   
Watermark text in search box
Is it possible with the Search Box web part to add a water mark text into the text box such as "Search Mysite.org" that disappears when the user clicks into the text box of the web part?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 9/7/2011 2:34:18 PM
   
RE:Watermark text in search box
Hello,

Regrettably, this feature isn't natively supported by Kentico. However you can achieve the mentioned effect with some javascript. Or you can use the following approch to create a custom search box and take the search values from it instead of the standard textbox:

<INPUT type="text" value="Search" onfocus="if
(this.value==this.defaultValue) this.value='';">

The smart search box is located here:

\CMSWebParts\SmartSearch\SearchBox.ascx

Best regards,
Boris Pocatko

User avatar
Member
Member
xristias - 7/26/2012 6:18:58 AM
   
RE:Watermark text in search box
You can utilize the ASP.NET Ajax Control Toolkit.
For start you must create a new custom layout for the search box web part.
You will then identify the id of the text box control and add the following code:

<ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" runat="server"
TargetControlID="textBoxSearch"
WatermarkText="Search..."
WatermarkCssClass="watermark_class" />