Zone wrote:
> I have tried to understand why input field is valid outside form tag.
> I seems to work outside form if e.g. input tag is inserted inside div tag.
>
> I tried to read http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> but didn't find any solution.
>
> Can anyone clearify were input is accepted if it's not inside form?
HTML 4 and XHTML 1 allow form controls outside of 'form' elements as you
might want form controls in your HTML document for scripting or other
reason where you do not need to submit form data to the server. On the
other hand an old browser like Netscape 4 does not render form controls
outside of 'form' elements but Netscape 4 is not of relevance anymore.
As for where the DTD defines that form controls are allowed outside of
'form' elements, the relevant definitions are as follows
<!ENTITY % inline.forms "input | select | textarea | label | button">
<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; |
%inline.forms;">
<!-- %Inline; covers inline or "text-level" elements -->
<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline

*">
<!ELEMENT p %Inline;>
that defines the contents of p elements and allows form controls
(defined by inline.forms). There are similar definitions for other
elements allowing form controls too.
--
Martin Honnen
http://JavaScript.FAQTs.com/