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 :
<form name="sform" id="sform" action=""
style="display:inline;">
<label for="item_name">Filter on item : </label>
<%=select_tag :field , options_for_select(@class.new.columns_name_hash,
params[:field])%>
<%=text_field_tag("query", params[:query], :size => 10 ) %>
</form>
<%= 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'')" %>
<div id="table">
<%= render :partial=> ''shared/listing''%>
</div>
<br />
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
--
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
-~----------~----~----~----~------~----~------~--~---