Hi Folk
I have written the following piece of code (from tutorial):
class Page_Controller extends ContentController {
function SearchForm() {
$searchText = isset($this->Query) ? $this->Query : 'Search';
$searchField = new TextField("Search", "", $searchText);
$fields = new FieldSet($searchField);
$resultAction = new FormAction("results","Go");
$actions = new FieldSet($resultAction);
return new SearchForm($this, "SearchForm", $fields, $actions);
}
I would like to add some JavaScript to the search field so that it automatically removes the word search onclick.
It seems like I can only do this in Sapphire or is there another way. I am not too keen to do it in Sapphire, because then it will get lost when I upgrade the site.
Any help greatly appreciated.
Nicolaas