In the demo at http://demo.script.aculo.us/ajax/autocompleter_customized
the input firld generated by text_field_with_auto_complete has an
autocomplete attribute set to off, which stops the browser using it's
own auto complete function, but when I use it, that attribute is now
there and Firefox's version gets in the way.
I've tried adding :autocomplete => "off" as an option, but that didn't
work, what am I missing?
Cheers
-S
I would expect it to automatically add that attribute. However if
it's not working then check out the defintion of the
text_field_with_auto_complete method:
text_field_with_auto_complete(object, method, tag_options = {},
completion_options = {})
Note that the autocomplete="off" would belong in the tag_options,
which means you would have explicitly wrap it in curly braces to
separate it from the completion_options. Or, the opposite problem
would be that you are clobbering the autocomplete attribute that is
included by default which would be solved by putting a blank
tag_options in. What does your code look like?
<%= text_field_with_auto_complete :vendor, :postcodes,
{ "autocomplete" => 'off' }, :skip_style => true %>
That is the field in question ...
I pasted that into one of my views and change the model/method name
and it worked. autocomplete="off" was the first attribute of the
input tag.
Are you on Rails 1.2.3 and do you have any plugins that much around
with the internals?
stuart@shearer:~$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i486-linux]
stuart@shearer:~$ rails -v
Rails 1.2.3
and vendor/plugins contins:
foreign_key_migrations/ redhillonrails_core/
simple_http_auth/ transactional_migrations/
Take the plugins out and see if it works. If not, start a new
application and just copy the view code in and see if it works.
The problem is being caused by Sxipper (http://www.sxipper.com), when
it is enabled, the autocomplete attribute of the field gets removed,
however with the plugin switched off, the autocomplete attribute
remains in place.
I'll raise a bug with the Sxipper team, as I don't see how this could
(or should?) be handled by the Ruby devs.
Thanks for your help this far Dasil003
-S