On Wed, Oct 22, 2008 at 10:41 AM, Oldřich Vetešník <span dir="ltr"><<a href="mailto:vetesnik@mrmil.cz">vetesnik@mrmil.cz</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I'd like to throw a question out here, please don't shoot me if it's been already answered, I'm a full-time coder and don't have an internet at home so I can't make any deep researches in your archives.<br>
<br>
Q: Is it possible that hidden inputs don't have to be in a semantic tag? That is it passes the validation test without showing this error up:<br>
line 20 column 32 - Error: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag<br>
<br>
It's because hidden inputs aren't meant to be shown to the front-end user so it doesn't mean if it's not covered in a semantic tag. Sometimes it's O.K., you have a form with a few fieldsets so you can put it in one, but sometimes it's rather stupid having to do <div><input type="hidden" name="somename" value="somevalue" /></div> just to silence the validator.<br>
<br>
Thank you,<br>
Ollie<br>
</blockquote></div><br>Big question here is, why is this necessary? You only use hidden inputs in a form. If you have a form, you'll have other inputs (at least a <input type=submit> or <button type=submit>), which *do* have to obey those semantic limits, and thus will be wrapped in an appropriate tag. Why can't you just stuff your hidden inputs in there along with them? The exact location of a hidden input is of absolutely no consequence in any way (except for it being in the appropriate <form>, of course), so you should always have an appropriate place for them.<br>
<br>~TJ<br>