Add default text to the search field

From KickApps Documentation

Jump to: navigation, search

To add default text inside the Search field box, put the following script inside the <head> or <footer> of your Global Page Template code.

CODE

<script>
//add default text to the search field
$j("input.ka_searchField").attr("value", "Search this community").css("color", "gray");
 
//remove the default text when the search field first gains focus
function removeSearchText(event) {
	$j("input.ka_searchField").attr("value", "");
	$j("input.ka_searchField").unbind("focus", removeSearchText);
}
 
$j("input.ka_searchField").bind("focus", removeSearchText);
</script>

This puts the text "Search your community" in the field.