submit_to_remote onclick clear ?

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!

Nobody knows? :frowning:

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).