Hi.... I''m trying to update the content in a div while the value of a hidden field is changed. <%= hidden_field "location", "id", "value" => 0 %> <%= observe_field("location_id", :update => "ci_location_container", :url => { :controller => :ci, :action => :choose_ci_location_ui }, :method => "post", :with => "''location_id=''+value") %> There is no response. But when I replaced the hidden_field with a select, it worked. I need to implement the observe_field with hidden_field itself. Please help me.... -- 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-/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 -~----------~----~----~----~------~----~------~--~---
When you test this... is the request going out how are you changing the hidden field? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Keynan Pratt wrote:> When you test this... > is the request going out > how are you changing the hidden field?There is a link called choose location. When I click on it, a popup box for selecting the location is shown. When I click on one location, the value of the hidden field will be changed. The code for changing the value of the hidden_field is given below: In the view search_ci_location.rhtml under popup controller: <script type="text/javascript"> function setLocation(location_id) { window.opener.document.forms[0].location_id.value=location_id; window.close() } </script> <a href="javascript:setLocation(<%= location.location_id%>);"><%= location.street %></a> -- 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-/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 -~----------~----~----~----~------~----~------~--~---
I don''t think that will trigger correctly. Can''t you add an Ajax request to the setLocation function directly? On Jan 21, 4:52 am, Suneeta Km <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Keynan Pratt wrote: > > When you test this... > > is the request going out > > how are you changing the hidden field? > > There is a link called choose location. When I click on it, a popup box > for selecting the location is shown. When I click on one location, the > value of the hidden field will be changed. > The code for changing the value of the hidden_field is given below: > > In the view search_ci_location.rhtml under popup controller: > <script type="text/javascript"> > function setLocation(location_id) > { > window.opener.document.forms[0].location_id.value=location_id; > window.close() > } > </script> > > <a href="javascript:setLocation(<%= location.location_id%>);"><%> location.street %></a> > -- > Posted viahttp://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-/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 -~----------~----~----~----~------~----~------~--~---
brewpoo wrote:> I don''t think that will trigger correctly. Can''t you add an Ajax > request to the setLocation function directly? > > On Jan 21, 4:52 am, Suneeta Km <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Can u please show me an example of how to do this? -- 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-/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 -~----------~----~----~----~------~----~------~--~---