Hai frnds, I hav two select boxes.1st selectbox for selecting the "state" and the 2nd selectbox will be populated with the "districts" based on the 1st select box value.I want to show some details according to the district selected. I am able to do these things.But i want to get both the id of 1st and 2nd select box in the action "show_readings_for_station".Can i pass two ids with periodically_call_remote? my code ........ <%= periodically_call_remote(:url => { :action=> "show_readings_for_station" }, :frequency => 5, :with=>"''district_id=''+document.getElementById(''_district_id'').value")%> "_district_id" is the id of 2nd select box. "_state_id" is the id of 1st select box. Thanks, Veena -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
yes but different parameters name like one is district_id and state_id On Fri, Apr 16, 2010 at 10:28 AM, Veena Jose <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hai frnds, > > I hav two select boxes.1st selectbox for selecting the "state" and > the 2nd selectbox will be populated with the "districts" based on the > 1st select box value.I want to show some details according to the > district selected. > > I am able to do these things.But i want to get both the id of 1st and > 2nd select box in the action "show_readings_for_station".Can i pass two > ids with periodically_call_remote? > > my code > ........ > <%= periodically_call_remote(:url => { :action=> > "show_readings_for_station" }, :frequency => 5, > :with=>"''district_id=''+document.getElementById(''_district_id'').value")%> > > "_district_id" is the id of 2nd select box. "_state_id" is the id of 1st > select box. > > Thanks, > Veena > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, If you need to pass two values using periodically call remote, trying :with option is a good idea. Yes, we can pass more than one values with it. Have a look at this, and try to follow the same - , :with => "''tag_last_id=''+#{last_activity.to_i}+''&tag_name=''+''#{tag}''" THIS ONE IF the values of _district_id and _state_id are INTEGER "''district_id=''+$(''_district_id'').value+''&state_id=''+$(''_state_id'').value" THIS ONE IF the values of _district_id and _state_id are STRING "''district_id=''+''$(''_district_id'').value''+''&state_id=''+''$(''_state_id'').value''" And if that doesn''t work it would be coz $(''element_id'').value DIDN''T WORK. so just replace it with document.getElementById(''element_id'').value and it should be working then. Good luck, Nitin. On Fri, Apr 16, 2010 at 10:28 AM, Veena Jose <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hai frnds, > > I hav two select boxes.1st selectbox for selecting the "state" and > the 2nd selectbox will be populated with the "districts" based on the > 1st select box value.I want to show some details according to the > district selected. > > I am able to do these things.But i want to get both the id of 1st and > 2nd select box in the action "show_readings_for_station".Can i pass two > ids with periodically_call_remote? > > my code > ........ > <%= periodically_call_remote(:url => { :action=> > "show_readings_for_station" }, :frequency => 5, > :with=>"''district_id=''+document.getElementById(''_district_id'').value")%> > > "_district_id" is the id of 2nd select box. "_state_id" is the id of 1st > select box. > > Thanks, > Veena > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you Nitin....Thank you Bala.... I got it worked..... Thank you sooooo much. This was a new learning for me... Thanks, Veena -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.