Remote form in form

Hi Jean-Etienne,

Jean-Etienne Durand wrote:

It seems I cannot add a remote form
within a form (helper is not generated at all).

That's correct. Forms cannot contain other forms. The W3C spec spells it out quite clearly.

The solution I've used in a situation similar to yours is to use Ajax for all the inputs (rendering a checkbox_tag with an associated observe_field, for example) with an empty form_remote_tag's submit button for page redirection. It looks and acts like a single form to the user. Potentially puts a heavier burden on you for form-level validation, though, since you're updating the model incrementally.

hth,
Bill

Jean-Etienne Durand wrote:

I tried to go for an oberver on a input (type button), but observer_field does not generate any html... This is included in a partial (coming from another observer action) Did I do somehting wrong?

Hard to tell without seeing your code :wink:

Jean-Etienne Durand wrote:

Or may I send you some code by mail?

My personal experience is that moving problem code over to my sandbox, paring it down to the bare essentials, using irb to investigate the behavior of specific methods, etc., more often than not shows me the problem and how to fix it. If need be, you can send along some code.

Best regards,
Bill