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 -->

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.

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.

Leave a Comment