> > Another related question to ask... Why is putting a hidden input 
> > field, as the first child of a form element, disallowed?

> The HTML 4.01 DTD specifies that only block-level elements or script
> elements may appear as the immediate children of the FORM element;
> input elements are inline:
> <http://www.w3.org/TR/html401/interact/forms.html#h-17.3>
> 
> As to _why_ this is the case, I'm really not sure :-)

:)

Indeed, my question wasn't "where in the spec...".

There is not a single useful reason I can think of as to why an inline element 
cannot be the first child of a form, eg: I would consider this to be a 
perfectly useable snippet:

...
<form action...>
  <input type="checkbox" id="enable_feature"/>
  <label for="enable_feature">Enable blah</label>
</form>
...

both the <input> and the <label> are inline elements.  Any other variation like 
<select>'s, <button>'s, etc would also be usable.  Thankfully, browsers quite 
happily ignore the spec; this is one area I dont bother fixing when the 
validators tell me that my page is borked.

Basically I think <form>'s should be %flow, just like a <div>.
Mathew Robertson


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [email protected]
*******************************************************************

Reply via email to