Hi Daniel,
Thanks. I haven’t tried the %q syntax (although that’s about the only
thing I haven’t tried!). I’ll give it a shot. I did find something on
the wiki just after I sent my original post that implies you can only
send back one params value but you can put a bunch of stuff into the
one string you’ll get back and then parse out the pieces. I definitely
hope your approach works, but at least it looks like there’s a way to do
what I need, even if it’s coyote-ugly 
Thanks again,
Bill
----- Original Message -----
From: Daniel N
To: [email protected]
Sent: Monday, June 26, 2006 8:57 AM
Subject: [Norton AntiSpam] Re: [Rails] syntax for observe_field( :with
=>
Hi Bill,
You can send anything back to your script. The syntax is pure
javascript that is eval’d. You can use it to build a custom parameter
string. I’m not sure if it needs to be escaped to be url encoded or
not.
:with => %q{“idate=” + $(‘date’).value + “&some_other_value=” +
$(‘some_other_field’).value}
Hope this is strictly correct. I’m sure someone will correct me
otherwise
at least I hope so.
On 6/26/06, Bill W. [email protected] wrote:
Greetings!
What is up with the syntax of this thing? I mean, if the only thing
I can send back using :with is the field being observed, then why in the
world is the syntax so convoluted? For example, what I’ve been able to
get working is:
<%= text_field_tag('date', illness_date, :size => 30) %></p>
<%= observe_field('date', :url => {:action => 'update_date', :id =>
illness_id}, :with => “‘idate=’+$(‘date’).value” ) %>
Of course, maybe I'm just doing it wrong. I suppose it might make
some sense if it’s possible to send more than one params value back with
the :with option. Does anybody know anything about how that might be
possible? I’ve spent a day and a half trying to figure it out and
haven’t been able to get anything but the above to work.
TIA,
Bill
_______________________________________________
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails