# Observe field is not working

**URL:** <https://www.ruby-forum.com/t/observe-field-is-not-working/177772>\
**Category:** Rails\
**Created:** [October 23, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/observe-field-is-not-working/177772 "2009-10-23T14:55:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssbava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@ssbava](https://www.ruby-forum.com/u/ssbava)\
**Post date:** [October 23, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/observe-field-is-not-working/177772/1 "2009-10-23T14:55:09Z")

</div>

Hi all,

I used observe field in my site as

\<%=text\_field :one,:new\_col%\>  
\<%= observe\_field(: :one\_new\_col,  
:url =\> { :action =\> :live\_search }),  
:frequency =\> 0.5,  
:update =\> :hits,  
:with =\> ‘query’  
%\>

And I got the javascript error as

element.tagName is undefined

Please give the solution.

Thanks  
Bava

---

<div class="post-metadata">

**Author:** ![ssbava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@ssbava](https://www.ruby-forum.com/u/ssbava)\
**Post date:** [October 23, 2009, 3:41pm UTC](https://www.ruby-forum.com/t/observe-field-is-not-working/177772/2 "2009-10-23T15:41:59Z")

</div>

On Fri, Oct 23, 2009 at 5:53 AM, ssbava [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> :with => 'query'
> 
> ```

Hi Bava, what field are you trying to observe?

\<%=text\_field :one,:new\_col %\>

=\>

Next, are you creating or updating a model? If you’re not, then I would  
recommend using

\<%=text\_field :one\_new\_col %\>

=\>

Finally, you’ll need to correct the following line because it has an  
extra  
colon:

\<%= observe\_field(: :one\_new\_col,

change it to

\<%= observe\_field( :one\_new\_col,

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![ssbava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@ssbava](https://www.ruby-forum.com/u/ssbava)\
**Post date:** [October 23, 2009, 3:41pm UTC](https://www.ruby-forum.com/t/observe-field-is-not-working/177772/3 "2009-10-23T15:41:59Z")

</div>

On Fri, Oct 23, 2009 at 6:40 AM, Conrad T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > ```
> > :frequency => 0.5,
> > 
> > ```
> > 
> > Thanks  
> > recommend using
> 
> \<%=text\_field :one\_new\_col %\>

The above should be

\<%= text\_field\_tag :one\_new\_col %\>

---

<div class="post-metadata">

**Author:** ![ssbava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/fbc32d/32.png) [@ssbava](https://www.ruby-forum.com/u/ssbava)\
**Post date:** [October 24, 2009, 9:44am UTC](https://www.ruby-forum.com/t/observe-field-is-not-working/177772/4 "2009-10-24T09:44:19Z")

</div>

Hi Conrad,  
Thanks for ur reply.  
I want to update the model,  
\<%= observe\_field(:one\_new\_col,  
:url =\> { :action =\> :live\_search }),  
:frequency =\> 0.5,  
:update =\> :hits,  
:with =\> ‘query’  
%\>

I have put like this only, previous mail I typed wrongly sorry for that  
still i am getting the same error. Please give a solution.

Thanks  
Bava
