This below code is forbidden in XHTML 1.1 strict mode:
<form method="post" action="index">
<input id="_method" name="_method" type="hidden" value="" />
</form>
If you want it to be valid then you need to wrap it with a div (or p, etc..) like:
<form method="post" action="index">
<div>
<input id="_method" name="_method" type="hidden" value="" />
</div>
</form>
How does this make any sense at all?
According to the W3C and this site the <form>
element in XHTML 1.1 may only contain block level elements and <fieldset>
.
As for why ... I believe that the reason that form
may only contain block-level elements is because it is not considered an element in itself, but rather a wrapper around other elements. There was some discussion of this in the w3c's mailing lists some years ago that I was able to dig up -- but nothing that actually answered the question.
Welcome to the wacky world of standards. Sometimes it seemed like the folks writing XHTML standards thought the language would be better if it had more rules.
HTML5 is here now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With