[thelist] PHP and problem validating XHTML strict page

Nathan Wright ominous at rmh-d.com
Sat Jul 6 12:24:00 CDT 2002


>Form element may contain ONLY block-level elements (such
as h*, p, div) except the form element itself, and script
elements.
>So the problem is not because of id absence, or case, or
anything else.
>It's only because the input (inline-level element) is not
contained directly in the form element.
>
><tip type="Form Syntax" author="Dmytro Borovsky">
>
>A form element can contain only block-level elements.
>Any inline-level elements must be included into a block-level
element.
>
>(Example: input is included into div:
><div><input /></div>
>)
>
></tip>
>

Dmytro,

So if I read your tip correctly, the proper format of a form
containing an inline element (like the <input /> tag) must
include a <div> as a block level "wrapper" of sorts. As in:

<form>
	<div>
		<input />
	</div>
</form>

Do I understand you correctly? I've attempted this (along with
Ed's suggestion), and it seems to work ... sort of. Because I
am not the one adding the input tag to the form (in fact, PHP
is auto-generating this tag entirely absent of my assistence), I
am unable to control the placement of this tag inside the
HTML ... and therefore I cannot wrap it in a <div> the way it
so desperately needs to be. Is there a way to turn this
"feature" in PHP off, or am I stuck with non-validating forms?

Thanks,
Nathan





More information about the thelist mailing list