Shripad
2008-Jul-21 06:04 UTC
Displaying Dropdown list value on selection of other dropdown list
Hi all, I want to do like following, I have Zone dropdown list, which contain West Zone, South Zone etc. when i select a value from this, i want to display all the regions in the selected zone in Region dropdown. What I have done is something like this, but it is not working good for me <select id="zone_id" name= "zone[id]" onchange="<%remote_function(:url => { :action => :showR }) %>"> <!-- <select id="zone_id" name= "zone[id]" onclick="" >--> <% @r= Zone.find_by_sql("select id,ZONE_ZoneName from zones")%> <% for item in @r %> <option value= "<%= item.id %>"><b><%= item.ZONE_ZoneName -%></b></ option> <% end %> </select> This calling the controller but the selected parameters are not pass to the controller I am doing this way. Is there any other way to do this? please help me, I am new to ROR Thanks and Regards, Shripad --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Shripad
2008-Jul-23 08:16 UTC
Re: Displaying Dropdown list value on selection of other dropdown list
hi Kiran, Thanks for ur reply I have used what u have mentioned, but it is not solving my problem do u have any other solution abt this. What I have done for this is, i used observer_field it is working fine in firefox but not working in IE do u have any solution Thanks and regards Shripad On Jul 21, 3:42 pm, kiranH <kiran.sou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hope this helps.... > > http://railsforum.com/viewtopic.php?pid=64003 > > Thanks. > > On Jul 21, 11:04 am, Shripad <shripad.josh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi all, > > > I want to do like following, > > > I have Zone dropdown list, which contain West Zone, South Zone etc. > > when i select a value from this, i want to display all the regions in > > the selected zone in Region dropdown. > > > What I have done is something like this, but it is not working good > > for me > > > <select id="zone_id" name= "zone[id]" onchange="<%> > remote_function(:url => { :action => :showR }) %>"> > > > <!-- <select id="zone_id" name= "zone[id]" onclick="" >--> > > <% @r= Zone.find_by_sql("select id,ZONE_ZoneName from zones")%> > > <% for item in @r %> > > <option value= "<%= item.id %>"><b><%= item.ZONE_ZoneName -%></b></ > > option> > > <% end %> > > </select> > > > This calling the controller but the selected parameters are not pass > > to the controller > > > I am doing this way. > > > Is there any other way to do this? > > please help me, I am new to ROR > > > Thanks and Regards, > > Shripad--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---