I need to have this remote_function method return more than a single value. Right now I have it being called when an input field blurs but I need it to pass more than the value for that one input field - I need it to pass three values. Here is what I got: remote_function( :update => ''h_phone'', :url => { :action => ''set_h_phone'', :id => @user.id}, :with => "Form.Element.serialize(''cc2'') ) For the :with, I have tried several variations such as: :with => "Form.Element.serialize(''cc2''), Form.Element.serialize(''cc3'')" But that doesn''t work. Is there a way to do this? Thanks in advance, -S -- 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 -~----------~----~----~----~------~----~------~--~---
On 7 May 2008, at 22:10, Shandy Nantz wrote:> > I need to have this remote_function method return more than a single > value. Right now I have it being called when an input field blurs > but I > need it to pass more than the value for that one input field - I > need it > to pass three values. Here is what I got: > > remote_function( :update => ''h_phone'', :url => { :action => > ''set_h_phone'', :id > => @user.id}, :with => "Form.Element.serialize(''cc2'') ) > > For the :with, I have tried several variations such as: > :with => "Form.Element.serialize(''cc2''), > Form.Element.serialize(''cc3'')"What are the values you need to pass (what are cc2, cc3 etc... ?) More generally what you pass to :with should be a query string, so for example Object.toQueryString({a: 1, b:2}) should work. Form.Element.serialize() does do that - it will create name=value pairs, but you do need to glue them together yourself. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 7 May 2008, at 22:10, Shandy Nantz wrote: > >> => @user.id}, :with => "Form.Element.serialize(''cc2'') ) >> >> For the :with, I have tried several variations such as: >> :with => "Form.Element.serialize(''cc2''), >> Form.Element.serialize(''cc3'')" > > What are the values you need to pass (what are cc2, cc3 etc... ?) > More generally what you pass to :with should be a query string, so for > example Object.toQueryString({a: 1, b:2}) should work. > Form.Element.serialize() does do that - it will create name=value > pairs, but you do need to glue them together yourself. > > FredI ended up using the :submit option. Those fields were for the three different parts of a phone field. Thanks for the help, -S -- 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 -~----------~----~----~----~------~----~------~--~---