On 18/08/2006 09:15, Bart Van der Donck wrote:
RobG wrote:
>A form can't be a child of a TR element, the HTML is invalid.
Depends on how your document defines "invalid HTML".
[snip]
Theoretically, yes, but before even thinking about custom DTDs, it's
important to consider how browsers really behave. After all, they work
to their own idea of HTML - trying to create your own definition is
pointless - and triggering error correction in a case such as this might
be disastrous.
The reasoning behind adopting valid HTML 4.01 is that no browser should
deem it necessary to perform error correction, therefore the document
tree is predictable. This is important for both scripting, and in cases
where elements should have a specific relationship with other elements
(such as form controls and their containing form). For instance, the
document tree in Firefox is thoroughly distorted: the form elements are
siblings of the table cells, and the form controls don't have a form
ancestor at all. Luckily for you, the controls are still associated with
the right form.
There's no justification here for not inserting the form elements in the
right place - within the table cells. An alternative is to use just a
single form, and have the server determine the destination based upon
the submitted data (the name/value pair of the activated submit button).
Mike