Success in Observe field

View: New views
1 Messages — Rating Filter:   Alert me  

Success in Observe field

by Adam Akhtar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,
How to call javascript function using success in observe field .

      <%= observe_field (ha.id,
          :frequency => 0.5,
          :update => "article_list_#{ha.id}",
          :url => {:action => :auto_complete_for_article_title, :id =>
ha.id},
          :with => "'article='+ escape(value)",
          :success => "close_title(#{ha.id})")%>

<div id="article_list_<%= ha.id %>"></div>

In javascript :
  function close_title(div_id){
    document.getElementById('article_list_'+div_id).style.display="block";
  }

I want to call close_title function for every success ie. status 200 OK
.
let me know if any there are any alternatives if wrong

thanks,
sri..
--
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@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---