Forum: Ruby on Rails Autocompleter to read value from hidden field

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.
Jesper Rønn-Jensen (Guest)
on 2006-04-18 00:40
(Received via mailing list)
I have an autocomplete field with road names (looking up in a database
approx. 100,000 road names).
To limit the number of roads, i want an extra input field where to put
postal code.

I'm currently using <%= text_field_with_auto_complete %> for the field.

What is the best way in Rails to intercept the Ajax call and send the
of the postal_code field?

(I guess I could do it by hand, but I think that there is a smarter way
doing this).


Emin H. (Guest)
on 2006-04-18 23:34
(Received via mailing list)
I believe you could play with the ":with" parameter of observe_field to
value of both fields with AJAX call instead of value of only the
field. For that, I would think you should put some javascript function
collects the value and concatenates it in some form to the value of
This topic is locked and can not be replied to.