<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>subtleGradient comments on Two (count 'em) TWO live search boxes</title>
    <link>http://subtlegradient.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>subtleGradient comments</description>
    <item>
      <title>"Two (count 'em) TWO live search boxes" by admin</title>
      <description>&lt;p&gt;I&amp;#8217;m still pretty &lt;strong style="color: green;;"&gt; green&lt;/strong&gt; when it comes to Ruby on Rails.&lt;/p&gt;


	&lt;p&gt;I decided that I wanted to have a live search box on the bottom of &lt;a href="http://subtlegradient.com/articles/2005/11/26/subtletheme" title="SubtleTheme"&gt;my theme&lt;/a&gt; for &lt;a href="http://typogarden.com" title="The Typo Theme Contest"&gt;the contest&lt;/a&gt;. I also want one for the top of &lt;a href="http://subtlegradient.com/articles/2005/11/26/subtletheme" title="SubtleTheme"&gt;my theme&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s really pretty easy to mess around in this code. It all just makes sense (assuming you have a good general idea of what&amp;#8217;s going on).&lt;/p&gt;


	&lt;p&gt;Anyway, I just wanted to blog a snippet you can use to have a second live search box in your theme.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
&amp;lt;%= start_form_tag({:controller =&amp;gt; 'articles',  :action =&amp;gt; 'search'}, {:method =&amp;gt; 'get', :id =&amp;gt; 'sform1'}) %&amp;gt;
 &amp;lt;h3&amp;gt;&amp;lt;label for="q"&amp;gt;Search&amp;lt;/label&amp;gt;&amp;lt;input type="text" id="q_bottom" name="q" value="" size="15" /&amp;gt;&amp;lt;%= image_tag "theme/spinner.gif", :id =&amp;gt; 'search_spinner1', :style =&amp;gt; 'display:none;' %&amp;gt;&amp;lt;/h3&amp;gt;

&amp;lt;%= end_form_tag %&amp;gt;
&amp;lt;%= observe_field "q_bottom", :frequency =&amp;gt; 1, 
    :url =&amp;gt; { :controller =&amp;gt; "live", :action =&amp;gt; "search" }, 
    :loading =&amp;gt; "Element.show('search_spinner1')",
    :complete =&amp;gt; "Element.hide('search_spinner1')",
    :update =&amp;gt; "search-results1",
    :with =&amp;gt; "'q=' + escape($F('q_bottom'))" -%&amp;gt;
&amp;lt;div id="search-results1"&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;enjoy :D&lt;/p&gt;

</description>
      <pubDate>Sun, 27 Nov 2005 21:17:00 PST</pubDate>
      <guid>&lt;a href="/articles/2005/11/27/two-live-search-boxes"&gt;Two (count 'em) TWO live search boxes&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2005/11/27/two-live-search-boxes"&gt;Two (count 'em) TWO live search boxes&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
