# Observe\_form that doesn't observe

**URL:** <https://www.ruby-forum.com/t/observe-form-that-doesnt-observe/116810>\
**Category:** Rails\
**Created:** [October 9, 2007, 11:49pm UTC](https://www.ruby-forum.com/t/observe-form-that-doesnt-observe/116810 "2007-10-09T23:49:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![esox\_ch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/4da419/32.png) [@esox\_ch](https://www.ruby-forum.com/u/esox_ch)\
**Post date:** [October 9, 2007, 11:49pm UTC](https://www.ruby-forum.com/t/observe-form-that-doesnt-observe/116810/1 "2007-10-09T23:49:07Z")

</div>

Hello,

I’ve got a form which contains a select and a text field, and I’d like  
to have a listener on them to use some Ajax after.

I tried this way :

Filter on item : \<%=select\_tag :field , options\_for\_select(@class.new.columns\_name\_hash, params[:field])%\> \<%=text\_field\_tag("query", params[:query], :size =\> 10 ) %\>

\<%= image\_tag(“spinner.gif”,  
:align =\> “absmiddle”,  
:border =\> 0,  
:id =\> “spinner”,  
:style =\>“display: none;” ) %\>

```
<%= observe_form 'sform',
  :update => :table,
  :before => "Element.show(â€™spinnerâ€™)",
  :success => "Element.hide(â€™spinnerâ€™)",
  :url => {:action => :user, :todo=>:list},
  :with => "Form.serialize('sform')" %>

```

\<%= render :partial=\> 'shared/listing'%\>
  

But it doesn’t work, basically the Ajax does nothing (the logs doesn’t  
show any request), however if I try to submit the form in the “normal  
way” (just pressing enter for instance), it works well.

Do you have any idea?

Thanks a lot
