observe_field Location select (help b4 I go mad)

Hi James,

James Kelly wrote:

I've been trying for days, without much success to add a 'Select Location' option to my site. I want to use observe_field so that a user
can select a Country, and then another list is populated with the appropriate cities.

This must be something that is needed all the time, but I just can't seem to find a decent tutorial (i'm a pretty new programmer!)

If you search the archives you'll find numerous discussions of this over the last year.

In general, the easiest way to accomplish this is to set the observe_field on your Country select so that it sends back the selected value using :with => whatever_you_want_the_param_to_be_named, then in the controller do a find on your Cities using the Country passed back in that param, then in your rjs template replace the content of the <div> containing your Cities select.

hth,
Bill