<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-29194345.post5628199261784906933..comments</id><updated>2009-10-01T07:41:57.578-07:00</updated><title type='text'>Comments on Code Intensity: Auto-Complete Text Fields in Rails 2</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codeintensity.blogspot.com/feeds/5628199261784906933/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default?start-index=26&amp;max-results=25'/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29194345.post-7466988350670384909</id><published>2009-10-01T07:41:57.578-07:00</published><updated>2009-10-01T07:41:57.578-07:00</updated><title type='text'>shikhap - the jQuery plugin I mentioned has nothin...</title><content type='html'>shikhap - the jQuery plugin I mentioned has nothing to do with the Rails part of the code, it does it completely via JavaScript and CSS, so the Ruby/Rails implementation has no bearing on it.  You would do this by having JavaScript similar to:&lt;br /&gt;&lt;br /&gt;$(&amp;#39;#clip_geog_id&amp;#39;).example(&amp;#39;Click Here&amp;#39;);&lt;br /&gt;&lt;br /&gt;That&amp;#39;s it, then you will get the exact behavior you want: it will say Click Here in the field, and when someone clicks in there, that text will go away, and you will get the regular autocomplete behavior.&lt;br /&gt;&lt;br /&gt;This of course only works if you&amp;#39;re using jQuery.  If you&amp;#39;re using Prototype or some other JavaScript library, look for a similar default text type of plugin.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/7466988350670384909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/7466988350670384909'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1254408117578#c7466988350670384909' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-8476652596680754812</id><published>2009-10-01T01:32:58.470-07:00</published><updated>2009-10-01T01:32:58.470-07:00</updated><title type='text'>See the implementation is already been done So I c...</title><content type='html'>See the implementation is already been done So I cant change the code from begining&lt;br /&gt;&lt;br /&gt;my code is like &lt;br /&gt;in html page I have following =&lt;br /&gt;model_auto_completer(&amp;quot;clip_geog_search&amp;quot;, &amp;quot;&amp;quot;,&amp;quot;clip_geog_id&amp;quot;, &amp;quot;&amp;quot;, {:action =&amp;gt; :classification_geogs_search}, {:style=&amp;gt;&amp;quot;width: 500px;&amp;quot;},{:min_chars=&amp;gt;3})&lt;br /&gt;&lt;br /&gt;and I want &amp;quot;Click Here&amp;quot; to be wriiten in background once the textbox get&amp;#39;s the focused clickhere will get removed and the , just like we have in google tool bar</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/8476652596680754812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/8476652596680754812'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1254385978470#c8476652596680754812' title=''/><author><name>shikhap</name><uri>http://www.blogger.com/profile/04418702304934509151</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-6492261594973358941</id><published>2009-09-30T20:02:18.608-07:00</published><updated>2009-09-30T20:02:18.608-07:00</updated><title type='text'>shikhap - I would suggest checking out the jQuery ...</title><content type='html'>shikhap - I would suggest checking out the jQuery form example plugin:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://github.com/mudge/jquery_example/tree/master" rel="nofollow"&gt;GitHub project/code page&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mucur.name/system/jquery_example/" rel="nofollow"&gt;home page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I use this to put in sample text in various form fields, but most often in search fields.  It&amp;#39;s super easy to use, allows styling, etc.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/6492261594973358941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/6492261594973358941'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1254366138608#c6492261594973358941' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-4806160561745273357</id><published>2009-09-30T04:09:58.810-07:00</published><updated>2009-09-30T04:09:58.810-07:00</updated><title type='text'>hello, I want to add a default text to auto comple...</title><content type='html'>hello, I want to add a default text to auto completer &lt;br /&gt;Just like on google we get google writtin in background by default</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4806160561745273357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4806160561745273357'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1254308998810#c4806160561745273357' title=''/><author><name>shikhap</name><uri>http://www.blogger.com/profile/04418702304934509151</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-9060775318339882620</id><published>2009-07-01T06:31:02.274-07:00</published><updated>2009-07-01T06:31:02.274-07:00</updated><title type='text'>Thanks. This is really useful stuff. I was looking...</title><content type='html'>Thanks. This is really useful stuff. I was looking for a way to implement Ajax without having to meddle with javascript. I found it!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/9060775318339882620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/9060775318339882620'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1246455062274#c9060775318339882620' title=''/><author><name>Pierrot</name><uri>http://www.blogger.com/profile/10485058314315581630</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-3878438243352766507</id><published>2009-06-30T00:01:57.225-07:00</published><updated>2009-06-30T00:01:57.225-07:00</updated><title type='text'>Thanks for the tip Chris!

Anyway, I found this pl...</title><content type='html'>Thanks for the tip Chris!&lt;br /&gt;&lt;br /&gt;Anyway, I found this plugin (http://model-ac.rubyforge.org/) that does exactly what I need in the fly.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/3878438243352766507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/3878438243352766507'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1246345317225#c3878438243352766507' title=''/><author><name>Benji Orozco</name><uri>http://www.blogger.com/profile/03250597332419699665</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-2888059598929131111</id><published>2009-06-29T20:52:43.087-07:00</published><updated>2009-06-29T20:52:43.087-07:00</updated><title type='text'>Benji, just take the code that it uses by default,...</title><content type='html'>Benji, just take the code that it uses by default, and implement you own autocomplete_... method that adds id&amp;#39;s in - you&amp;#39;ll need to separate them so that you still get the text back to display in the pulldown list.  I don&amp;#39;t use this anymore, and don&amp;#39;t have the JS handy to look at at the moment, but you may be able to add the ID&amp;#39;s with something like &amp;quot;list text|id&amp;quot; as the text you return and have the JavaScript that creates the pulldown menu rip off the pipe and ID at the end for display, etc.  This is how the jQuery version I use works.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2888059598929131111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2888059598929131111'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1246333963087#c2888059598929131111' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-3732237789499256735</id><published>2009-06-29T20:30:47.678-07:00</published><updated>2009-06-29T20:30:47.678-07:00</updated><title type='text'>I'm using autoconmpleter plugin to help customer f...</title><content type='html'>I&amp;#39;m using autoconmpleter plugin to help customer find book titles quickly, so they can add them to their favorites.&lt;br /&gt;&lt;br /&gt;Is there a way that this plugin can Return the ID of the selected product ? So it can be passed to the form (and not having to re-search for the id based of the selected string) ?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/3732237789499256735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/3732237789499256735'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1246332647678#c3732237789499256735' title=''/><author><name>Benji Orozco</name><uri>http://www.blogger.com/profile/03250597332419699665</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-4813888724440672853</id><published>2009-06-24T16:17:34.642-07:00</published><updated>2009-06-24T16:17:34.642-07:00</updated><title type='text'>Guduta, that's a valid observation for sure.  As m...</title><content type='html'>Guduta, that&amp;#39;s a valid observation for sure.  As mentioned above, I don&amp;#39;t actually use this anymore, and use jQuery, but even then, I don&amp;#39;t even use a plugin, there&amp;#39;s really no need, as these things are very simple to write yourself, and as you alude to, writing your autocomplete method specific to the implementation you need will yield the best results.  At DealBase we have a couple fairly complex ones that do searches across joined tables and other such things.  Performance can get tricky for sure.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4813888724440672853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4813888724440672853'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1245885454642#c4813888724440672853' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-4434872452311690206</id><published>2009-06-24T14:52:45.693-07:00</published><updated>2009-06-24T14:52:45.693-07:00</updated><title type='text'>Just to notice that 

auto_complete_for_doctor_org...</title><content type='html'>Just to notice that &lt;br /&gt;&lt;br /&gt;auto_complete_for_doctor_organization&lt;br /&gt;&lt;br /&gt;method shown here is extermly slow code unusable for big tables.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4434872452311690206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4434872452311690206'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1245880365693#c4434872452311690206' title=''/><author><name>Gudata</name><uri>http://www.blogger.com/profile/17655119689392972987</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-9169656279666381190</id><published>2009-06-22T14:16:29.398-07:00</published><updated>2009-06-22T14:16:29.398-07:00</updated><title type='text'>Arvind, honestly, I'm not sure on that.  I don't u...</title><content type='html'>Arvind, honestly, I&amp;#39;m not sure on that.  I don&amp;#39;t use Prototype anymore, purely jQuery, so I do all my autocomplete stuff with jQuery instead.  But, I know at least the jQuery plugin I use has that option as to whether the first item is selected by default or not, etc.  Thus, I&amp;#39;d suggest poking around in the JavaScript code and seeing if there&amp;#39;s an option for that, or an easy way to modify it, etc.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/9169656279666381190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/9169656279666381190'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1245705389398#c9169656279666381190' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-2009722583636397591</id><published>2009-06-21T13:03:40.302-07:00</published><updated>2009-06-21T13:03:40.302-07:00</updated><title type='text'>Hi there!

I am using auto-complete to provide pos...</title><content type='html'>Hi there!&lt;br /&gt;&lt;br /&gt;I am using auto-complete to provide possible search terms in a text-box (text search). The problem I&amp;#39;m facing is that whenever auto-complete opens up the suggestion list, it has already selected the topmost entry.&lt;br /&gt;Now when I hit &amp;quot;Enter&amp;quot; on the keyboard - it will substitute my string with the first entry of the auto-completing list. This way I&amp;#39;m virtually unable to type in a search term that is a substring of one or more auto-suggested entries.&lt;br /&gt;&lt;br /&gt;How can I make sure that the auto-suggested items are NOT selected unless i manually select them with either the mouse pointer or the arrow-keys?&lt;br /&gt;&lt;br /&gt;Also - how can I make this faster?&lt;br /&gt;I gave a pretty low number for the &amp;quot;:frequency&amp;quot;, but that only results in it re-opening the auto-complete suggestion list immediately after I hit &amp;quot;Enter&amp;quot;... thus making me hit &amp;quot;Enter&amp;quot; multiple times before it finally stops that and lets the form be submitted.&lt;br /&gt;&lt;br /&gt;How do I solve THAT too?&lt;br /&gt;&lt;br /&gt;Thanks!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2009722583636397591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2009722583636397591'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1245614620302#c2009722583636397591' title=''/><author><name>Arvind</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-2201942202920581741</id><published>2009-06-04T08:48:40.914-07:00</published><updated>2009-06-04T08:48:40.914-07:00</updated><title type='text'>@andy, could you please clarify on two of these fo...</title><content type='html'>@andy, could you please clarify on two of these for the same field ?&lt;br /&gt;&lt;br /&gt;you can have any combination of auto-complete functions and form fields.&lt;br /&gt;&lt;br /&gt;But you can at once map only one auto-complete function to one field.&lt;br /&gt;&lt;br /&gt;If you tried two different fields, check if any of the form field names, etc. are getting duplicated. There could be a conflict, rename one of them.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2201942202920581741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2201942202920581741'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1244130520914#c2201942202920581741' title=''/><author><name>Tarun</name><uri>http://www.blogger.com/profile/16692322484683959261</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-6703681787915393953</id><published>2009-06-03T11:43:00.589-07:00</published><updated>2009-06-03T11:43:00.589-07:00</updated><title type='text'>Is it possible to use 2 of these on the same page ...</title><content type='html'>Is it possible to use 2 of these on the same page for the same field?  I&amp;#39;ve tried but only one functions</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/6703681787915393953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/6703681787915393953'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1244054580589#c6703681787915393953' title=''/><author><name>Andy Milk</name><uri>http://www.blogger.com/profile/17596244362108848200</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-2485984201178062099</id><published>2009-02-20T17:02:00.000-08:00</published><updated>2009-02-20T17:02:00.000-08:00</updated><title type='text'>txbarbarossa ya, I realize i'm wrong on that, beca...</title><content type='html'>txbarbarossa ya, I realize i'm wrong on that, because blur probably gets activated as soon as the autocomplete kicks in, and it'll only have the user's typed value at that point.  I'm not sure in Prototype the exact thing to use, but if the autocomplete JavaScript code has a callback for when it gets results, then you could just tell the form to submit at the end of that handler (possibly, may or may not be quite the right time, but hopefully it's populated the results into the form by then).  &lt;BR/&gt;&lt;BR/&gt;Probably worth googling for a bit, as I'm sure others have done this kind of thing.  Let me know if you find a good solution.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2485984201178062099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2485984201178062099'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235178120000#c2485984201178062099' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-1981327373829143522</id><published>2009-02-20T16:42:00.000-08:00</published><updated>2009-02-20T16:42:00.000-08:00</updated><title type='text'>chris, yeah it's weird i've tried that, but instea...</title><content type='html'>chris, &lt;BR/&gt;&lt;BR/&gt;yeah it&amp;#39;s weird i&amp;#39;ve tried that, but instead of the autocompleted text, it submits to the form the text the user typed that generated the autocomplete text instead of the full autocomplete result.&lt;BR/&gt;&lt;BR/&gt;e.g.:&lt;BR/&gt;text_field_with_auto_complete :sku, :name, :autocomplete =&amp;gt; &amp;quot;off&amp;quot;, :onblur =&amp;gt; &amp;quot;this.form.submit();&amp;quot;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/1981327373829143522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/1981327373829143522'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235176920000#c1981327373829143522' title=''/><author><name>txbarbarossa</name><uri>http://www.blogger.com/profile/05760716229969461971</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-2615623557542842391</id><published>2009-02-20T12:51:00.000-08:00</published><updated>2009-02-20T12:51:00.000-08:00</updated><title type='text'>txbarbarossa, I don't use the Prototype/Scriptacul...</title><content type='html'>txbarbarossa, I don't use the Prototype/Scriptaculous stuff or this plugin anymore, I just use jQuery (and I have a jQuery version of the plugin).  So, it won't be a mod I do.  That said, what I'd suggest is just adding a JavaScript event listener for the "change" event on the field that you're populating, and then have that handler do a submit or whatever needs to happen.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2615623557542842391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/2615623557542842391'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235163060000#c2615623557542842391' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-4471366889087479662</id><published>2009-02-20T12:14:00.000-08:00</published><updated>2009-02-20T12:14:00.000-08:00</updated><title type='text'>Chris: anyway to make it where when the user click...</title><content type='html'>Chris: anyway to make it where when the user clicks from the typeahead selection list, that it auto fires a submit action to the encapsulating form - instead of selecting the text and then having to hit a submit button?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4471366889087479662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4471366889087479662'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235160840000#c4471366889087479662' title=''/><author><name>txbarbarossa</name><uri>http://www.blogger.com/profile/05760716229969461971</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-5443092601508954458</id><published>2009-02-19T10:00:00.000-08:00</published><updated>2009-02-19T10:00:00.000-08:00</updated><title type='text'>Sergueï, I would actually suggest you ditch this o...</title><content type='html'>Sergueï, I would actually suggest you ditch this one and use the jQuery autocomplete instead, given that you have jQuery in your app.  I think the jQuery approach is better.&lt;BR/&gt;&lt;BR/&gt;For the hidden field, at least in the jQuery version, what I do is return the ID of the item as the &amp;quot;data&amp;quot; portion of each element that I send back from my autocomplete method.  Then, my JavaScript results handler for that takes that data element and populates the hidden field with it.  I do this a fair bit in my current app.  I also have ones where the &amp;quot;data&amp;quot; element actually has two or three pieces of info in it, and I update two or three form fields (some hidden, some not) with that info.  &lt;BR/&gt;&lt;BR/&gt;I don&amp;#39;t use the non-jQuery version at all anymore, and haven&amp;#39;t for probably almost a year, so I&amp;#39;m just not up to speed with it, or with Prototype &amp;amp; Scriptaculous, etc.  I only use jQuery now and have removed Prototype and Scriptaculous from my apps.  Just works better for me.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/5443092601508954458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/5443092601508954458'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235066400000#c5443092601508954458' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-5079984336696255192</id><published>2009-02-19T07:08:00.000-08:00</published><updated>2009-02-19T07:08:00.000-08:00</updated><title type='text'>How can we add a hiddent field to get an 'id' of s...</title><content type='html'>How can we add a hiddent field to get an 'id' of selected item using content_tag like you do in case of auto_complete from belongs_to side&lt;BR/&gt;&lt;BR/&gt;render :inline content_tag(:ul, @organizations.map { |org| content_tag(:li, h(org)) })</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/5079984336696255192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/5079984336696255192'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235056080000#c5079984336696255192' title=''/><author><name>Sergueï</name><uri>http://www.blogger.com/profile/00770611935010732154</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-3798002462135409860</id><published>2009-02-19T03:03:00.000-08:00</published><updated>2009-02-19T03:03:00.000-08:00</updated><title type='text'>Chris, I think you misunderstood because I didn't ...</title><content type='html'>Chris, I think you misunderstood because I didn&amp;#39;t explained it well. I don&amp;#39;t want to replace Rails autocomplete with jQuery autocomlpete plugin. I use jQuery for other purposes in my app, that&amp;#39;s why I would like to use Rails auto_complete for my text_fields and jQuery for other page elements. So if I delete &amp;#39;jquery-1.2.6.min.js&amp;#39; from my layout where it&amp;#39;s declared as &amp;#39;javascript_include_tag :defaults, &amp;quot;jquery-1.2.6.min.js&amp;quot;, :cache =&amp;gt; true&amp;#39;, your auto_complete works, if not it doen&amp;#39;t work.Any idea?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/3798002462135409860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/3798002462135409860'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235041380000#c3798002462135409860' title=''/><author><name>Sergueï</name><uri>http://www.blogger.com/profile/00770611935010732154</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-4638109904589039570</id><published>2009-02-19T01:25:00.000-08:00</published><updated>2009-02-19T01:25:00.000-08:00</updated><title type='text'>Sergueï, yes, you want to use the jQuery version :...</title><content type='html'>Sergueï, yes, you want to use the jQuery version :)  Or, with jQuery, I tend to just roll my own, as it's easy enough. Regardless, here are a few resources:&lt;BR/&gt;&lt;BR/&gt;&lt;A HREF="http://github.com/chris/auto_complete_jquery/tree/master" REL="nofollow"&gt;my jquery autocomplete plugin on GitHub&lt;/A&gt;&lt;BR/&gt;&lt;BR/&gt;&lt;A HREF="http://codeintensity.blogspot.com/2008/07/update-on-rails-jquery-autocomplete.html" REL="nofollow"&gt;my most up to date blog entry on it&lt;/A&gt; and the &lt;A HREF="http://codeintensity.blogspot.com/2008/06/rails-jquery-auto-complete-and-new.html" REL="nofollow"&gt;original blog entry on the jQuery version&lt;/A&gt;&lt;BR/&gt;&lt;BR/&gt;Basically, though, I just write the methods myself in my current work, as I typically need something more custom, but depends on your needs.  The jQuery plugin I refer to in my plugin is the one I'm using though.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4638109904589039570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4638109904589039570'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235035500000#c4638109904589039570' title=''/><author><name>Chris</name><uri>http://www.blogger.com/profile/14204551800123292694</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09484488674450120205'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-4069650087797915894</id><published>2009-02-19T01:18:00.000-08:00</published><updated>2009-02-19T01:18:00.000-08:00</updated><title type='text'>Hi Chris! Your plugin makes its magic fine. But if...</title><content type='html'>Hi Chris! Your plugin makes its magic fine. But if I try to use in a project that use jQuery, it doesn't work. Is there a trick to get it work beause I need some jQuery fucntion nevertheless.Thank you.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4069650087797915894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/4069650087797915894'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1235035080000#c4069650087797915894' title=''/><author><name>Sergueï</name><uri>http://www.blogger.com/profile/00770611935010732154</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-6657712485360057841</id><published>2009-02-17T20:25:00.000-08:00</published><updated>2009-02-17T20:25:00.000-08:00</updated><title type='text'>anyway to make it where when the user clicks from ...</title><content type='html'>anyway to make it where when the user clicks from the typeahead selection list, that it auto fires a submit action to the ecapsulating form - instead of selecting the text and then having to hit a submit button?&lt;BR/&gt;&lt;BR/&gt;thanks</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/6657712485360057841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/6657712485360057841'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1234931100000#c6657712485360057841' title=''/><author><name>txbarbarossa</name><uri>http://www.blogger.com/profile/05760716229969461971</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-29194345.post-7023846107794757380</id><published>2009-02-17T14:11:00.000-08:00</published><updated>2009-02-17T14:11:00.000-08:00</updated><title type='text'>any way to add some extra ajax options? like I'd l...</title><content type='html'>any way to add some extra ajax options? like I&amp;#39;d like to do: &lt;BR/&gt;&lt;BR/&gt;text_field_with_auto_complete :sku, :name, :autocomplete =&amp;gt; &amp;quot;off&amp;quot;, :before =&amp;gt; &amp;quot;Element.show(&amp;#39;\&lt;BR/&gt;spinner&amp;#39;)&amp;quot;, :complete =&amp;gt; &amp;quot;Element.hide(&amp;#39;spinner&amp;#39;)&amp;quot;&lt;BR/&gt;&lt;BR/&gt;but the doesn&amp;#39;t seem to work on my page</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/7023846107794757380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29194345/5628199261784906933/comments/default/7023846107794757380'/><link rel='alternate' type='text/html' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html?showComment=1234908660000#c7023846107794757380' title=''/><author><name>txbarbarossa</name><uri>http://www.blogger.com/profile/05760716229969461971</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://codeintensity.blogspot.com/2008/02/auto-complete-text-fields-in-rails-2.html' ref='tag:blogger.com,1999:blog-29194345.post-5628199261784906933' source='http://www.blogger.com/feeds/29194345/posts/default/5628199261784906933' type='text/html'/></entry></feed>