Does anyone have any information or links to tutorials on how to have
a select list update other fields in a form using ajax?
Example. I have list of customers stored in a database. I would like
to have a drop down containing a list of customers on a form, that
when selected, would update several input fields on a form with the
customer details from the database.
Use the Rails observe_field function (http://api.rubyonrails.org/
classes/ActionView/Helpers/PrototypeHelper.html#M000966):-
Here is an example of it in use (http://www.railshosting.org/ #live_searching), obviously they are using it for a different purpose
but the underlying logic is the same:-
Observe field changing
Make AJAX request
Update page element
Regards,
Jabbslad
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.