Ajax auto_complete_field


#1

Hello all.

Can anyone tell me how can I update two form fields (at the same time)
using auto_complete_field?

Thanks for all your help.

Best regards,
H


#2

Hugo M.alhães <hlists@…> writes:

Hello all.
Can anyone tell me how can I update two form fields (at the same
time)
using auto_complete_field?

See pages 403-404 in the Agile Web D. with Rails book–it tells
you how
to do it. The basic idea is that instead of sending just HTML back to
the client
browser to fill in one DOM container, you instead send back Javascript.
That
Javascript runs on the client side, so has full access to the DOM for
the web
page, so it can update anything on the page you want. In your case, you
could
send back a mix of HTML to fill in the first field and Javascript that
will
cause the second field to be filled in.

–Forrest