# If only I could get 'observe\_field' to fire?

**URL:** <https://www.ruby-forum.com/t/if-only-i-could-get-observe-field-to-fire/113312>\
**Category:** Rails\
**Created:** [August 29, 2007, 7:12pm UTC](https://www.ruby-forum.com/t/if-only-i-could-get-observe-field-to-fire/113312 "2007-08-29T19:12:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2007, 7:12pm UTC](https://www.ruby-forum.com/t/if-only-i-could-get-observe-field-to-fire/113312/1 "2007-08-29T19:12:23Z")

</div>

I’ve been programming in Rails for about a year and have made great  
progress. If I could just fire an event inside a form and respond with  
code, I could go much further.  
I’ve created an example using the observe\_field javascript applet and  
can’t get it to respond. Here’s a very simple example where the user  
is selecting from a SELECT statement and once this hurdle is jumped  
the observe\_field should fire by showing all the params.

**Category:**  
 \<% @ecats.each do |ecat| %\> \> \<%= ecat.description %\> \<% end %\>

\<%= observe\_field “ecat\_id”,  
:update =\> ‘params.inspect’ %\>  
I don’t seem to be getting the consolidated list of this forum anymore  
and would appreciate a reply to my email address below.  
Thank you,  
Kathleen  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 29, 2007, 9:01pm UTC](https://www.ruby-forum.com/t/if-only-i-could-get-observe-field-to-fire/113312/2 "2007-08-29T21:01:44Z")

</div>

On 8/29/07, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<% @ecats.each do |ecat| %\>  
> \<option value=“\<%= ecat.id %\>”  
> \<%= ’ selected’ if ecat.id == @eitem.ecat\_id %\>\>  
> \<%= ecat.description %\>  
>   
> \<% end %\>
> 
> \<%= observe\_field “ecat\_id”,  
> :update =\> ‘params.inspect’ %\>

You haven’t given a :url or :function option. One or the other is  
required.

In a situation like this, always look at the generated JavaScript to  
make sure it’s generating what you expect. Also, use Firebug so you  
can trace XHR and see if it fires and if any errors are returned.

> I don’t seem to be getting the consolidated list of this forum anymore  
> and would appreciate a reply to my email address below.

Um, no.
