Forum: Ruby on Rails form reset through rjs

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.
734a7bce0ec28ecc63ab0bc92cfa3182?d=identicon&s=25 Pawel Jur (pabloz)
on 2007-07-17 19:08
I have update.rjs

if @category.errors.length > 0
page.replace_html 'flash_box', error_messages_for(:category) 'flash_box'
page.hide 'flash_box'
page.replace_html @category.dom_id, :partial => "category", :locals => {
:category => @category}
page.visual_effect  :highlight, @category.dom_id, :startcolor =>
page.replace_html 'form_add_new', :partial => "index"

So basicly i am updating a div with edited category(works), then I try
to replace the form from edit form to add new category form(works) but i
cannot clear
this form, it still has values from my edit form even though i am making
a .reset.

This method works on my create.rjs
i dont have errors in firebug.
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-07-19 01:15
(Received via mailing list)

   > page["category_form"].reset

You may try something like :



Alain Ravet
This topic is locked and can not be replied to.