views:

92

answers:

1

I've got my autocomplete plugin working perfectly... except I have certain info that I want displayed in the autocomplete divs, but I don't want to end up when the user makes their selection.

Ie... I have an auto complete for currencies... they can search by either currency code or country... as they search it displays both info along with the countries flag.

Form:

<%= text_field_with_auto_complete :currency, :from, { :size => "10", :value => "USD" }, :skip_style => true %>

Partial:

<li class="currency"><div class="image"><img src="/images/flags_currency/<%=h code %>.png"/></div><div class="name"><%=h code %></div><div class="country"> <%=h other %></div></li>

But after their selection I would like it not to put the country name into the box, I would like to somehow edit it out, either using javascript or CSS?

Any ideas?

+2  A: 

How about:

text_field_with_auto_complete :currency, :from, 
     { :size => "10", :value => "USD" },
     :skip_style => true, :select => :name

From the options for auto_complete_field.

cwninja
ah yes, awesome.
holden