Shelby,
Use the :complete attribute to perform javascript function to clear the form
(in this case: with the unique id of "add_foo_time".)
<%= form_remote_tag(
:url => { :action => :add_time_request_option },
:update => "current_student_time_requests",
:position => "bottom",
:complete => "Field.clear(''add_foo_time'')",
:failure => "alert(''Failure!'')") %>
On 7/17/05, Shelby Westman
<shelby.westman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Well, I just wrote my first Ajax call in Rails. Its very simple - a
> form submits text which the controller adds as a <LI> to a list. It
> works!
>
> However, I noticed that after I submit the form, the textfield still
> holds the text of the value I just submitted. This must be because
> the form itself is not being rewritten. How do I clear out that text?
>
> My form looks like this...
>
> <%= form_remote_tag(:update =>
"current_student_time_requests",
> :url => { :action => :add_time_request_option },
> :position => "bottom") %>
> time request option: <%= text_field_tag :time_request_option,
> value=nil, :size=>''30''%><br>
> <%= submit_tag "Submit"%>
>
> Thanks....
>
> Shelby
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Nathan Colgate Clark
Web Developer, Jews for Jesus
http://www.jewsforjesus.org
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails