AJAX Action from onchange

How do I make an Ajax action run by an :onchange in a select?

On 17 Jun 2008, at 20:46, Pål Bergström wrote:

How do I make an Ajax action run by an :onchange in a select?

remote_function

Fred

Frederick C. wrote:

On 17 Jun 2008, at 20:46, P�l Bergstr�m wrote:

How do I make an Ajax action run by an :onchange in a select?

remote_function

Fred

Great :slight_smile: How do I add that to a rails select helper (and not a regular
html one)?

On Jun 17, 2:27 pm, Pål Bergström [email protected]
wrote:

Great :slight_smile: How do I add that to a rails select helper (and not a regular
html one)?

form.select(‘foo’, @some_foos, {},
:onchange => remote_function(:url => fancy_ajax_action_here,
:with => “‘foo=’ + escape(this.value)” ))

Aaron

Aaron B. wrote:

On Jun 17, 2:27�pm, P�l Bergstr�m [email protected]
wrote:

Great :slight_smile: How do I add that to a rails select helper (and not a regular
html one)?

form.select(‘foo’, @some_foos, {},
:onchange => remote_function(:url => fancy_ajax_action_here,
:with => “‘foo=’ + escape(this.value)” ))

Aaron

Thanks :slight_smile:

You could try an observe_field observing your select field.

On Jun 18, 6:38 am, PÃ¥l Bergström [email protected]