Forum: Ruby on Rails submit_to_remote onclick clear ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Guillaume L. (Guest)
on 2009-02-19 23:34
Hello everyone!

I would like to clear my textarea when the user click on the "Submit"
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!
Guillaume L. (Guest)
on 2009-02-23 19:26
Nobody knows? :(
Frederick C. (Guest)
on 2009-02-23 20:25
(Received via mailing list)
On Feb 23, 5:26 pm, Guillaume L. <rails-mailing-l...@andreas-> 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).

This topic is locked and can not be replied to.