Christophe,

Thanks for this information - I got it working great now.

I had some trouble getting the :select option to pick out the <span>
that I was after, but I soon worked out that the syntax for the
autocomplete was:-

<% text_field_with_auto_complete :model, :column, {}, :select =>
"myspan" %>

I didnt realise that you needed the empty braces '{}' after the column
name to get the parameters in the right order.

Thanks again for your help - I appreciate it.



On Apr 23, 4:23 pm, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> CyberFerret a écrit :
>
> > I have a RoR form for taking line items for an order.  I have got
> > autocomplete working for the Product Description so that users can
> > find a product really easily.  What I want though, is for whenever a
> > user accepts a product description using the autocompleter, the
> > product_code, product_units and product_price fields also get
> > automatically populated from the selected record from the product
> > masterfile.
>
> Put these in your <li>'s as well, say in <span> elements with proper
> class names (you can then exclude them from auto-completion use by
> properly setting the auto-completer's 'select' option).
>
> Then use the afterUpdateElement callback to grab these ($$ or
> getElementsByClassName should do) and auto-populate your other fields.
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to