<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: adding onclick to search form button</title>
			<link>http://www.silverstripe.org/archive/show/1369?start=0#post1408</link>
			<description>&lt;p&gt;Those files will have been included because you've enabled the page commenting. There's some javascript for ajax on the comments interface that depends on behaviour and prototype.&lt;/p&gt;&lt;p&gt;Cheers,&lt;br /&gt;Sean&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: adding onclick to search form button &lt;a href=&quot;http://www.silverstripe.org/archive/show/1369?start=0#post1408&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/1369?start=0#post1408&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 05 Jun 2007 11:19:19 +1200</pubDate>
			<dc:creator>Sean</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/1369?start=0#post1408</guid>
		</item>
		
		<item>
			<title>Re: adding onclick to search form button</title>
			<link>http://www.silverstripe.org/archive/show/1369?start=0#post1402</link>
			<description>&lt;p&gt;Hi Sean&lt;/p&gt;&lt;p&gt;Thank you for your reply.&lt;/p&gt;&lt;p&gt;I noticed that all my pages have the the following JS attached (added to my source code) by default:&lt;/p&gt;&lt;p&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jsparty/behaviour.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jsparty/prototype.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jsparty/scriptaculous/effects.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;cms/javascript/PageCommentInterface.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;p&gt;Why would that be?  It is not in the template/age.ss file and not in the code/page.php file, that is for sure....&lt;/p&gt;&lt;p&gt;The behaviour does not really seem to work either.... (but not JS errors).&lt;/p&gt;&lt;p&gt;Any suggestions?&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: adding onclick to search form button &lt;a href=&quot;http://www.silverstripe.org/archive/show/1369?start=0#post1402&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/1369?start=0#post1402&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Tue, 05 Jun 2007 00:46:04 +1200</pubDate>
			<dc:creator>Nicolaas</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/1369?start=0#post1402</guid>
		</item>
		
		<item>
			<title>Re: adding onclick to search form button</title>
			<link>http://www.silverstripe.org/archive/show/1369?start=0#post1372</link>
			<description>&lt;p&gt;If you include the behaviour script as requirements for your class you can create a new js file with something like this:&lt;/p&gt;&lt;p&gt;eg. Page.php&lt;/p&gt;&lt;p&gt;class Page_Controller extends ContentController {&lt;/p&gt;&lt;p&gt;   function init() {&lt;br /&gt;      Requirements::javascript('jsparty/behaviour.js');&lt;br /&gt;      Requirements::javascript('mysite/javascript/SearchForm.js');&lt;br /&gt;      parent::init();&lt;br /&gt;   }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;And then, you can create your SearchForm.js file (Replace the # ID with the correct search input field ID if this one isn't correct:&lt;/p&gt;&lt;p&gt;Behaviour.register({&lt;br /&gt;  '#Search_Form_SearchForm_Search' : {&lt;br /&gt;    onfocus : function() {&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(this.value == 'Search') this.value = '';&lt;br /&gt;    },&lt;br /&gt;    onblur : function() {&lt;br /&gt;    &amp;nbsp;&amp;nbsp;&amp;nbsp;if(this.value == '') this.value = 'Search';&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;});&lt;/p&gt;&lt;p&gt;Hope this helps!&lt;/p&gt;&lt;p&gt;Cheers,&lt;br /&gt;Sean&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: adding onclick to search form button &lt;a href=&quot;http://www.silverstripe.org/archive/show/1369?start=0#post1372&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/1369?start=0#post1372&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Fri, 01 Jun 2007 13:26:51 +1200</pubDate>
			<dc:creator>Sean</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/1369?start=0#post1372</guid>
		</item>
		
		<item>
			<title>adding onclick to search form button</title>
			<link>http://www.silverstripe.org/archive/show/1369#post1369</link>
			<description>&lt;p&gt;Hi Folk&lt;/p&gt;&lt;p&gt;I have written the following piece of code (from tutorial):&lt;br /&gt;class Page_Controller extends ContentController {&lt;br /&gt; function SearchForm() {&lt;br /&gt;  $searchText = isset($this-&amp;gt;Query) ? $this-&amp;gt;Query : 'Search';&lt;br /&gt;  $searchField = new TextField(&quot;Search&quot;, &quot;&quot;, $searchText);&lt;br /&gt;  $fields = new FieldSet($searchField);&lt;br /&gt;  $resultAction = new FormAction(&quot;results&quot;,&quot;Go&quot;);&lt;br /&gt;  $actions = new FieldSet($resultAction);&lt;br /&gt;  return new SearchForm($this, &quot;SearchForm&quot;, $fields, $actions);&lt;br /&gt; }&lt;/p&gt;&lt;p&gt;I would like to add some JavaScript to the search field so that it automatically removes the word search onclick.&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;Any help greatly appreciated.&lt;/p&gt;&lt;p&gt;Nicolaas&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: adding onclick to search form button &lt;a href=&quot;http://www.silverstripe.org/archive/show/1369#post1369&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/1369#post1369&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Fri, 01 Jun 2007 10:07:28 +1200</pubDate>
			<dc:creator>Nicolaas</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/1369#post1369</guid>
		</item>
		

	</channel>
</rss>