Forum: Ruby on Rails scriptaculous - auto complete textbox with a drop down

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.
Pete (Guest)
on 2006-05-26 16:45
Hi,

I'm using scriptaculous to provide an auto complete textbox - and it
works perfectly - but I was wondering if there was anyway to let users
navigate the choices using the keyboard i.e the curor keys as opposed to
having to use the mouse? Apart from that it's perfect! :)


Cheers,


Pete
Kevin O. (Guest)
on 2006-05-26 17:01
(Received via mailing list)
On Friday, May 26, 2006, at 2:45 PM, Pete wrote:
>
>Pete
>
>
>--
>Posted via http://www.ruby-forum.com/.
>_______________________________________________
>Rails mailing list
>removed_email_address@domain.invalid
>http://lists.rubyonrails.org/mailman/listinfo/rails

I have been using the auto_complete fields and I think they already do.

_Kevin
Pete (Guest)
on 2006-05-26 17:17
Kevin O. wrote:
> On Friday, May 26, 2006, at 2:45 PM, Pete wrote:
>>
>>Pete
>>
>>
>>--
>>Posted via http://www.ruby-forum.com/.
>>_______________________________________________
>>Rails mailing list
>>removed_email_address@domain.invalid
>>http://lists.rubyonrails.org/mailman/listinfo/rails
>
> I have been using the auto_complete fields and I think they already do.
>
> _Kevin

Just tried it on my mac and linux and it works fine... maybe just my IE
playing up? :S

Different issue now though - I want to update the rest of the form when
the user tabs out of the autocomplete box. Normally I'd do this with
onBlur() but not sure how to set that up if using the helper methods.
Has anyone done this already?


Cheers,


Pete
Kevin O. (Guest)
on 2006-05-26 17:30
(Received via mailing list)
On Friday, May 26, 2006, at 3:17 PM, Pete wrote:
>>>removed_email_address@domain.invalid
>the user tabs out of the autocomplete box. Normally I'd do this with
>Posted via http://www.ruby-forum.com/.
>_______________________________________________
>Rails mailing list
>removed_email_address@domain.invalid
>http://lists.rubyonrails.org/mailman/listinfo/rails

How about a field observer?

_Kevin
Damon H. (Guest)
on 2006-07-12 23:19
(Received via mailing list)
Pete-

I am curious about this as well.
I have several text_field_with_auto_complete fields in some forms that
are
heavy data entry intensive.
The auto complete fields allow the user to start typing a name and then
when
chosen the address is automatically filled in for them.
Everything works great if the user uses the moust to select the item
from
the auto complete list.
However, if the user types and the correct item is highlighted in the
auto
complete list, they want to be able to TAB to the next field and the
application complete the address just as if they had selected the entry
with
the mouse.

Here is an example of my TFWAC:

<%= text_field_with_auto_complete :supplier, :company_name, { :size =>
"45"
}, :after_update_element => "function(element,value){" +
            remote_function( :url => { :action => :get_supplier_address
},
:with => "'supplier='+$F('supplier_company_name') + '&order_type='+'T'")
+
"}" %>

Is there a way to tell the TFWAC to use the highlighted item in the auto
complete list when the user hits the TAB key?

Any help would be appreciated on this.

Thanks,
~d


On 26 May 2006 13:25:30 -0000, Kevin O. <
Kevin O. (Guest)
on 2006-07-13 01:02
(Received via mailing list)
On Wednesday, July 12, 2006, at 2:16 PM, Damon H. wrote:
>However, if the user types and the correct item is highlighted in the auto
>:with => "'supplier='+$F('supplier_company_name') + '&order_type='+'T'") +
>
>> >>>
>> >> _Kevin
>> >Cheers,
>>
>>
>removed_email_address@domain.invalid
>http://lists.rubyonrails.org/mailman/listinfo/rails
>
On my dev box (Firefox, OS X), the tab button tells the TFWAC to use the
selected item as you might expect.

_Kevin
This topic is locked and can not be replied to.