Forum: Ruby on Rails text_field_with_auto_complete onselect

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
82fdd815fedbcd9cca7eb94644a0530b?d=identicon&s=25 cfingerh (Guest)
on 2007-05-11 21:12
(Received via mailing list)
I'm trying to use a autocomplete text field like the one showed in

It works. But I want to call a javascript function just afterwards the
users selects one name.

Is there any
to use with text_field_with_auto_complete  ?


7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (Guest)
on 2007-05-11 21:51
(Received via mailing list)
On May 11, 2007, at 9:11 PM, cfingerh wrote:

>          onselect=>'do_something()'
> to use with text_field_with_auto_complete  ?

Yes, there's:

   :after_update_element => "function (e, v) { ... }"

The first argument of the JavaScript function is the textfield
element and so e.value holds the selection, v is the corresponding
list item.

-- fxn
This topic is locked and can not be replied to.