I have a page that has a text field on it which in turn has an
observe_field hooked up to it.  As the user types in the field, a list
of items on the page gets filtered by that entry.  This all works fine.
On the same page, I also have a hidden div that sometimes gets ajaxed
into view using the following:
  def add_item_to_list
    render :update do |page|
      page[''item_name''].value = ''''
      page.visual_effect :appear,''add_item_panel'', :duration
=> 0.5
      page["item_name"].focus()
    end
  end
User types in this newly visible text field and then hits an ajax done
button which "un-appears" the add_item div.
Now that that div is gone, the filter field mentioned at the beginning
of this post no longer makes the observe_field action happen.  You can
type stuff in that field, and it has focus etc.  Acts normally in all
ways except that it no longer seems to have an observe_field hooked to
it.
The "hidden" div has a form_remote_tag in it to enable the use of the
add_item text field.  I''m guessing that this other form coming into
play
is hosing up the observe field for the original form on the main page.
Any ideas?
thanks,
jp
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Have you used Firebug to see what it tells you? Cheers, Zach Inglis → Blog -- http://www.zachinglis.com → Company -- http://www.lt3media.com → Portfolio -- http://portfolio.zachinglis.com On Jun 6, 2007, at 11:58 PM, Jeff Pritchard wrote:> > I have a page that has a text field on it which in turn has an > observe_field hooked up to it. As the user types in the field, a list > of items on the page gets filtered by that entry. This all works > fine. > > On the same page, I also have a hidden div that sometimes gets ajaxed > into view using the following: > def add_item_to_list > render :update do |page| > page[''item_name''].value = '''' > page.visual_effect :appear,''add_item_panel'', :duration => 0.5 > page["item_name"].focus() > end > end > > User types in this newly visible text field and then hits an ajax done > button which "un-appears" the add_item div. > > Now that that div is gone, the filter field mentioned at the beginning > of this post no longer makes the observe_field action happen. You can > type stuff in that field, and it has focus etc. Acts normally in all > ways except that it no longer seems to have an observe_field hooked to > it. > > The "hidden" div has a form_remote_tag in it to enable the use of the > add_item text field. I''m guessing that this other form coming into > play > is hosing up the observe field for the original form on the main page. > > Any ideas? > > thanks, > jp > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
Zach Inglis // LT3media wrote:> Have you used Firebug to see what it tells you?Thanks Zach. So far I''ve only used FireBug for solving CSS problems. What should I look for to solve an issue like this one? By using logger.info I''ve already determined that the observe_field is not kicking the action when something is typed. Don''t know what to look for. Is there a good article somewhere about debugging with Firebug? thanks, jp -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---