Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Little things like search field onclick

Go to End

2 Posts   1692 Views


Community Member, 12 Posts

4 March 2009 at 3:40pm

How would I go about putting code to seach field onclick? Like currently, the default term is 'Search' and what i am trying to do is clear that field on click. Or where to change so that the search field is blank by default. Any pointers would be helpful. Thanks,



Administrator, 690 Posts

4 March 2009 at 4:22pm

I would recommend that you use jQuery for this. Any jQuery tutorial should be able to guide you through that.

To get your javascript files into your site, put code like this into the init() method of the Page_Controller class.