Hi everyone, I have a select box with an observe field; i update another select box on first ones change. Is there a way to update more than one select box on change. I need to update 2 select boxes based on the selection of the first one. Any input is appreciated Thank you, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
can you paste some of your code? On 5/4/07, jimache <vl_ionel-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:> > > Hi everyone, > > I have a select box with an observe field; i update another select box > on first ones change. Is there a way to update more than one select > box on change. I need to update 2 select boxes based on the selection > of the first one. Any input is appreciated > > Thank you, > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi,> I have a select box with an observe field; i update another select box > on first ones change. Is there a way to update more than one select > box on change. I need to update 2 select boxes based on the selection > of the first one. Any input is appreciated >sure you can do that. When you call observe_field you usually have the :update parameter filled in, which means "write the return of the action to the element with this id". when you want to update multiple elements with an ajax call, what you do is just not provide an :update parameter. That way, the ajax called is managed in a slightly different way. In that case, you will have in your rjs (or in your action by using render :update) an object called "page" which represents your document object in javascript. you could do something like page.replace_html id_of_the_first_dependant_box, :partial=>whatever page.replace_html id_of_the_second_dependant_box, :partial=>whatever regards, javier ramirez -- -------- Estamos de estreno... si necesitas llevar el control de tus gastos visita http://www.gastosgem.com !!Es gratis!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---