Forum: Ruby on Rails submit_to_remote onclick clear ?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
007bac1f27905cd4d5d88315e9b0093a?d=identicon&s=25 Guillaume Loader (loader)
on 2009-02-19 22:34
Hello everyone!

I would like to clear my textarea when the user click on the "Submit"
button.
Ths thing is I'm using a submit_to_remote button. I heard that's
impossible to add an option onclick to clear my textarea.

<%= submit_to_remote 'comment', 'Submit', ajax_options(:url => {
:controller => '/ticket_comments', :action => :create }, :update =>
{:success => "comment_list"}, :validation => true) %>

Do you have an idea?

Thank you!
007bac1f27905cd4d5d88315e9b0093a?d=identicon&s=25 Guillaume Loader (loader)
on 2009-02-23 18:26
Nobody knows? :(
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-02-23 19:25
(Received via mailing list)
On Feb 23, 5:26 pm, Guillaume Loader <rails-mailing-l...@andreas-
s.net> wrote:
> Nobody knows? :(

Well you can certainly add the usual ajax callbacks (onComplete,
onSuccess etc... (and those might be preferable to a raw onclick - you
might not want to reset the field if the user clicks submit but your
server then raises an error).

Fred
>
 --
This topic is locked and can not be replied to.