RESOLVED: checkbox_tag outside a form?

Hi Alexander,

alexander wrote:

it´s not really that ror doesn´t support forms in forms… it´s the
browsers that don´t.

I need to understand more about the browser-side issue with this. Is it
that they don’t support behavior that’s allowed / specified by W3C? Or
does
the spec itself say this is inappropriate?

we had a problem a bit like yours. what we did is just place the
“subform” in a

that was outside the other form and just positioned
it “inside” the other form later. that worked.

The more I’ve thought about it, the more this seem like the ‘right’ way
to
approach the problem. Make the ‘containing’ form more of a visual
device
with respect to sub-form elements. Unfortunately, it seems to require
considerable expertise in CSS in order to grow / shrink the containing
form
dynamically based on the size of the sub-forms. Or maybe there’s an
easier
way to handle the positioning. If anyone has any knowledge to share on
this, I’d definitely appreciate it. My current level of CSS skill is
very
basic.

At any rate…

The solution I came up with is to

  1. eliminate the containing form, using button_to to advance to the next
    page
  2. put each checkbox (still bound to the model) inside a
    with an
    accompanying observe_field that
  3. causes RJS-based update of the summary record and create / delete
    activity for the related individual records.
  4. The use of the checkbox, rather than checkbox_tag allows initial
    population
    of the checkboxes based on the values in the summary record.
    Eliminating
    the containing form meand

<…>

it´s not really that ror doesn´t support forms in forms… it´s the
browsers that don´t.
<…>
I need to understand more about the browser-side issue with this. Is it
that they don’t support behavior that’s allowed / specified by W3C? Or does
the spec itself say this is inappropriate?

Where did you get the idea, that nested forms are allowed?
From DTDs:

HTML 4.01:

XHTML 1.0

Just for the sake of completeness:
HTML 3.2:

HTML 2.0

That this means is: nesting forms is not allowed and never was.

Regards,
Rimantas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs