Re: Reset form fields after they have changed with a remote_function

The problem is that the reset only affects that which is in the form when the DOM is originally created.

You could do several things

1) Just update the entire form, with the new elements inserted where appropriate, so that everything you want to reset is in the form.

2) Make separate forms, each with a reset, so that the div id=custom_notifications contains it's own form and reset button.

3) You could use JavaScript to manually reset the new elements added in the custom_notifications. You'd have to manually construct the JavaScript, and send it back along with the HTML when updating the div, the JavaScript would have to fire on the form's reset event.

Last edited by BradHodges (2011-10-21 15:42:44)

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Reset form fields after they have changed with a remote_function

I noticed you're using rails 2.X (remote_function)

If you go the JavaScript route, I looked and found something in my own code that is similar to what you'd need to do, but it's using Builder::XmlMarkup. I use Builder::XmlMarkup all he time to construct HTML in the controller, it's pretty handy.