I need to hide the smallsearchbox until the page loads. Is there a way to inject a java script function into the process so that once the pages loads the box becomes visible?
|
Actually, you neither need to go the long route of creating a replacement smallsearchbox DelegateControl, nor do you need to change the HTML body of your masterpage as mentioned in other answers. All you need is the following CSS:
which will hide the searchbox from the UI. Now you need some JavaScript to make it visible again once the page finished loading. This could either be done with jQuery or with plain and simple script like this:
The quick & dirty way to implement the above CSS & script code is to put it inside the The clean and reusable way is to develop a custom SharePoint DelegateControl as a feature and staple it on the placeholder "AdditionalPageHead", like described here: and here: How can I enable JavaScript on every page at a site level? The "AdditionalPageHead" approach has the added advantage that you can turn it off and on simply by flipping the feature on/off and it can be applied to any masterpage on any site. |
||||
|
|
|
If you want to do it for all the pages/sites then remove the
When SharePoint renders the page it definitely needs some contentplaceholders although you don't use it. The best way is to make them invisible. |
|||
|
|
|
You need a delegate control: http://msmvps.com/blogs/sundar_narasiman/archive/2011/02/19/sharepoint-2010-delegate-control-to-replace-smallsearchinputbox.aspx |
|||
|
|