Friday, October 23, 2009

[Rails] Re: observe field is not working

On Fri, Oct 23, 2009 at 6:40 AM, Conrad Taylor <conradwt@gmail.com> wrote:
On Fri, Oct 23, 2009 at 5:53 AM, ssbava <ssbava@gmail.com> wrote:

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


Hi Bava, what field are you trying to observe?  

<%=text_field :one,:new_col %>

=>  <input id="one_new_col" name="one[new_col]" size="30" type="text" /> 

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

<%=text_field :one_new_col %>

The above should be

<%= text_field_tag :one_new_col %>
 

=>  <input id="one_new_col" name="one_new_col" type="text" />

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
 




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate