Forum OpenACS Development: Re: HTML Strict as default DTD

Collapse
Posted by Tom Jackson on
Looking at the strict DTD, FORM elements can only contain block elements or script elements, so it isn't just that INPUTs must be wrapped in a block element, you can't have any text or other inline content as direct children to FORM.

This is also true of BODY! And OL/UL can only have whitespace and LI content.

I'm not sure why you have to enclose a form in a DIV, how did that happen?

It also looks like A tags require a closing tag.

Something else which shows up on pages with user provided content, like in this forum is BLOCKQUOTE. This tag can't have inline content, you have to use another block level tag.

I've done some tests for simple forms, what works and doesn't:

http://junom.com/document/html/strict/

The failed HTML is under failed/.

Collapse
Posted by Emmanuelle Raffenne on
Hi Tom,

Thanks for completing the list and your tests.

Regarding forms, form builder takes care of everything so it is strongly recommended to use it. Actually it was already html strict compliant except for hidden fields that I had to wrap into DIV.

Collapse
Posted by Tom Jackson on
It looks like HTML 4.01 Strict is very useful. I noted the above points because I usually violate them, while at the same time, adding things which are not required. The DTD is relatively easy to read, and W3 has a link on their home page to validate any page you would like to test. But my old habits will be hard to overcome.

For instance, closing tags for LI and P are optional.

I'm still interested in the details of the choices for FORM.

Why did it need to be wrapped in a DIV? This doesn't appear to have anything to do with the requirements for Strict.

Another question is using a DIV to wrap the hidden inputs.

Are you providing a class for this DIV so that users can ensure that it doesn't contribute to any additional whitespace, indents or whatever? It seems like it would be helpful to have a generic class for this type of application.

I'll try to provide some additional examples.

Collapse
Posted by Emmanuelle Raffenne on
Hi Tom,

I'm not sure the need to wrap form in a DIV (or other block tag) has anything to do with Strict.

About the DIV for hidden inputs, there's no class for them so far (and no additional whitespace nor indents either in my testing).

What do you mean by "I'm still interested in the details of the choices for FORM"?