remote_function and :with =>

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

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

Frederick Cheung wrote: