11175
(-- --)
#1
How do I pass more than one parameter through :with in a field observer?
Here is my code:
< %= observe_field(’article_image_id’,
:frequency => 0.25,
:update => ‘image_preview’,
:url => { :action => :image_preview },
:with => “‘id=’+value”) %>
I need to pass also another value. How should I modify the code?
Thanks
Stefano
AndyV
(AndyV)
#2
You're just building up a string that represents the query string for
the http request using javascript,so add
'&my_new_param='+my_param_value
rubynuby
(rubynuby)
#3
I'd like to add that you may need to encode the parameter
:with => "'myparam='+encodeURIComponent($F('form_field_id'))
+'¶m2='+encodeURIComponent($F('form_field_id'))"
You should indeed be doing that. There's some other ways of doing
this, I wrote about it over at
http://www.spacevatican.org/2008/5/17/with-or-without-you-link_to_remote-s-mysterious-parameter
Fred