Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Little things like search field onclick

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

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

Page: 1
Go to End
Author Topic: 1199 Views
  • cnyaviary
    Avatar
    Community Member
    12 Posts

    Little things like search field onclick Link to this post

    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,

    George

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Little things like search field onclick Link to this post

    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.

    Requirements::javascript('jsparty/jquery/jquery.js');
    Requirements::javascript('mysite/javascript/searchExtras.js');

    1199 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.