<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Use javascript/prototype to get a text field value for link_to_remote</title>
	<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/</link>
	<description>The Vixiom Blog :: Flex &#38; Flash on Rails</description>
	<pubDate>Tue,  2 Dec 2008 02:53:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Gavin Laking</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-58340</link>
		<dc:creator>Gavin Laking</dc:creator>
		<pubDate>Thu, 26 Jun 2008 14:17:03 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-58340</guid>
		<description>I'm an idiot. You need to add another ampersand to the begining of booking[centre_id] like this: '&#38;booking[centre_id]='

Sorry about that. (That's what comes of not testing my code!)</description>
		<content:encoded><![CDATA[<p>I&#8217;m an idiot. You need to add another ampersand to the begining of booking[centre_id] like this: &#8216;&amp;booking[centre_id]=&#8217;</p>
<p>Sorry about that. (That&#8217;s what comes of not testing my code!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin Laking</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-58338</link>
		<dc:creator>Gavin Laking</dc:creator>
		<pubDate>Thu, 26 Jun 2008 13:45:45 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-58338</guid>
		<description>I've posted here since I used this page as the basis to get the first parameter in there; someone else Googling will hopefully reach here too. If you want to put multiple parameters in there; it's simple once you know how (but I took 15 minutes to get this working properly!):

link_to_remote 'Check Availability', {:update =&#62; "check", :url =&#62; {:controller =&#62; "availability", :action =&#62; "check"}, :with =&#62; "'booking[date]=' + $F('booking_date') + 'booking[centre_id]=' + $F('booking_centre_id')"}

The magic is once again in the :with, but convention leads you to believe that HTTP parameters should be passed with an ampersand, in Rails though it's the concatenation symbol + (plus).

Hope that helps someone.

Gav</description>
		<content:encoded><![CDATA[<p>I&#8217;ve posted here since I used this page as the basis to get the first parameter in there; someone else Googling will hopefully reach here too. If you want to put multiple parameters in there; it&#8217;s simple once you know how (but I took 15 minutes to get this working properly!):</p>
<p>link_to_remote &#8216;Check Availability&#8217;, {:update =&gt; &#8220;check&#8221;, :url =&gt; {:controller =&gt; &#8220;availability&#8221;, :action =&gt; &#8220;check&#8221;}, :with =&gt; &#8220;&#8216;booking[date]=&#8217; + $F(&#8217;booking_date&#8217;) + &#8216;booking[centre_id]=&#8217; + $F(&#8217;booking_centre_id&#8217;)&#8221;}</p>
<p>The magic is once again in the :with, but convention leads you to believe that HTTP parameters should be passed with an ampersand, in Rails though it&#8217;s the concatenation symbol + (plus).</p>
<p>Hope that helps someone.</p>
<p>Gav</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Gerlach</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-19209</link>
		<dc:creator>Robert Gerlach</dc:creator>
		<pubDate>Tue, 06 Feb 2007 19:49:22 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-19209</guid>
		<description>@Carl: I had the same problem. I had the :with-part in the :url-Hash.

@Adrian: :with =&#62; â€œâ€˜group%5Bname%5D=â€™+$F(â€™group_nameâ€™)+'&#38;param2=foo&#38;param3=barâ€</description>
		<content:encoded><![CDATA[<p>@Carl: I had the same problem. I had the :with-part in the :url-Hash.</p>
<p>@Adrian: :with =&gt; â€œâ€˜group%5Bname%5D=â€™+$F(â€™group_nameâ€™)+&#8217;&amp;param2=foo&amp;param3=barâ€</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Carr</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-17393</link>
		<dc:creator>Adrian Carr</dc:creator>
		<pubDate>Sat, 06 Jan 2007 11:17:17 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-17393</guid>
		<description>Hi. I was wondering if there is a way to send multiple parameters with link_to_remote? I've been searching and trying, to no avail.
Thanks,
Adrian</description>
		<content:encoded><![CDATA[<p>Hi. I was wondering if there is a way to send multiple parameters with link_to_remote? I&#8217;ve been searching and trying, to no avail.<br />
Thanks,<br />
Adrian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-10975</link>
		<dc:creator>Carl</dc:creator>
		<pubDate>Tue, 19 Dec 2006 14:49:02 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-10975</guid>
		<description>Hello, It does not seem to work.  here some logs:

Processing ShopAdminController#get_full_address (for 127.0.0.1 at 2006-12-19 14:35:54) [POST]
  Session ID: 8e638876f4cdef90e7b9ac74bbf6160b
  Parameters: {"action"=&#62;"get_full_address", "id"=&#62;"$F('country')", "controller"=&#62;"shop_admin", "with"=&#62;"'shop%5Bpostcode%5D='+$F('shop_postcode')"}
  [4;36;1mUser Columns (0.010000)[0m   [0;1mSHOW FIELDS FROM users[0m
  [4;35;1mUser Load (0.010000)[0m   [0mSELECT * FROM users WHERE (users.`id` = 2 ) LIMIT 1[0m
Completed in 0.04000 (25 reqs/sec) &#124; Rendering: 0.00000 (0%) &#124; DB: 0.02000 (50%) &#124; 200 OK [http://localhost/shop_admin/get_full_address/%24F%28%27country%27%29?with=%27shop%255Bpostcode%255D%3D%27%2B%24F%28%27shop_postcode%27%29]

shop_postcode should have returned the value. It looks like the new helper escapes the javascript....

Any ideas. If I put an alert for $F('shop_postcode'), I get the value entered....

/Carl</description>
		<content:encoded><![CDATA[<p>Hello, It does not seem to work.  here some logs:</p>
<p>Processing ShopAdminController#get_full_address (for 127.0.0.1 at 2006-12-19 14:35:54) [POST]<br />
  Session ID: 8e638876f4cdef90e7b9ac74bbf6160b<br />
  Parameters: {&#8221;action&#8221;=&gt;&#8221;get_full_address&#8221;, &#8220;id&#8221;=&gt;&#8221;$F(&#8217;country&#8217;)&#8221;, &#8220;controller&#8221;=&gt;&#8221;shop_admin&#8221;, &#8220;with&#8221;=&gt;&#8221;&#8217;shop%5Bpostcode%5D=&#8217;+$F(&#8217;shop_postcode&#8217;)&#8221;}<br />
  [4;36;1mUser Columns (0.010000)[0m   [0;1mSHOW FIELDS FROM users[0m<br />
  [4;35;1mUser Load (0.010000)[0m   [0mSELECT * FROM users WHERE (users.`id` = 2 ) LIMIT 1[0m<br />
Completed in 0.04000 (25 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.02000 (50%) | 200 OK [http://localhost/shop_admin/get_full_address/%24F%28%27country%27%29?with=%27shop%255Bpostcode%255D%3D%27%2B%24F%28%27shop_postcode%27%29]</p>
<p>shop_postcode should have returned the value. It looks like the new helper escapes the javascript&#8230;.</p>
<p>Any ideas. If I put an alert for $F(&#8217;shop_postcode&#8217;), I get the value entered&#8230;.</p>
<p>/Carl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KreeK</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-595</link>
		<dc:creator>KreeK</dc:creator>
		<pubDate>Thu, 02 Nov 2006 19:41:28 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-595</guid>
		<description>the information comes across in the params, so the new method for the above example would be

def new 
    @group = Group.new
    @group.name = params[:group][:name]
    @group.save
    render(:partial =&gt; '/groups/group')
end</description>
		<content:encoded><![CDATA[<p>the information comes across in the params, so the new method for the above example would be</p>
<p>def new<br />
    @group = Group.new<br />
    @group.name = params[:group][:name]<br />
    @group.save<br />
    render(:partial => &#8216;/groups/group&#8217;)<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent</title>
		<link>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-593</link>
		<dc:creator>Brent</dc:creator>
		<pubDate>Thu, 02 Nov 2006 18:16:48 +0000</pubDate>
		<guid>http://blog.vixiom.com/2006/10/19/use-javascriptprototype-to-get-a-text-field-value-for-link_to_remote/#comment-593</guid>
		<description>What does the controller code looks like? Do you use request.raw_post &#124;&#124; request.query_string  ?</description>
		<content:encoded><![CDATA[<p>What does the controller code looks like? Do you use request.raw_post || request.query_string  ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
