Can I nest form tags in other form tags?

No, nested forms are forbidden.


This is expressed in the HTML 4.01 DTDs as:

<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->

http://www.w3.org/TR/html4/interact/forms.html#h-17.3

This means A FORM has a mandatory start tag, mandatory end tag and can contain anything in %block or SCRIPT, except other FORMs.


XML DTDs aren’t as expressive as SGML DTDs so in XHTML this rule is specified only in the human readable text of the specification:

form must not contain other form elements.

http://www.w3.org/TR/xhtml1/#prohibitions


HTML 5 isn’t an SGML application and doesn’t have an official machine readable description of the language. It also expresses this rule in text:

Content model:

Flow content, but with no form element descendants.

http://www.w3.org/TR/html5/forms.html#the-form-element

Leave a Comment