Forum: Ruby on Rails Ajax.Autocompleter with an empty field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joshua Gitlin (Guest)
on 2006-03-03 01:03
(Received via mailing list)
Hey guys,

I have a field that will have very few autocomplete options. I have
an ajax.autocompleter on it that works great, but I wanted to make it
start autocompleting as soon as the field is blur()ed, so that even
if the field is empty, the list will still appear. Like a combo box
in windows. How can I do this? Setting :min_chars => 0 (or even -1)
didn't work...

-Josh
Chaz_Meister_Rock (Guest)
on 2006-03-11 23:20
Joshua Gitlin (Guest)
on 2006-03-12 00:45
Chaz_Meister_Rock wrote:
> checkout the "frequency" option:
>
> http://wiki.script.aculo.us/scriptaculous/show/Aja...

Well, that didn't work. But it made me realize that :min_chars isn't
working, either! My code is:

<%=
text_field_with_auto_complete :the_object, :project_name, {}
                              {:with =>
"'client='+$F('the_object_client_id')+'&'+value",
                               :min_chars => 3,
                               :frequency => 0.1
                              }
%>

Yet even with :min_chars => 3, the text filed auto completes with one
char...

Am I doing this wrong?
This topic is locked and can not be replied to.