嵌套表单在HTML5中是否有效? [英] Are nested forms valid in HTML5?

查看:112
本文介绍了嵌套表单在HTML5中是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嵌套表单可接受?



我无法在 HTML5 doc ,它讨论嵌套的表单。我确定它在某个页面上列出(可能是更新日志),但如果不是这样,我应该假设不提及是否可以接受?

另外, HTML4文档没有提到它。

上一次提到

XHTML1.0


表单不能包含其他表单元素。 HTML 3.0


单个文档中可以有多种形式,但FORM元素不能嵌套。



解决方案

HTML5文档在上面链接的部分


内容模型



流内容,但没有表单元素后代。


内容模型的意思是这个元素可能包含什么。因此,不允许嵌套表单。


Nested Forms Acceptable?

I can't find anything in the HTML5 doc that talks about nested forms. I'm sure it's listed on some page, somewhere (perhaps a changelog), but if not, should I assume that no-mention is the same as acceptable?

Additionally, the HTML4 doc doesn't mention it. Perhaps it's been permitted all along and I was adhering to old standards.

Previous Mentions

XHTML1.0

form must not contain other form elements.

HTML 3.0

There can be several forms in a single document, but the FORM element can't be nested.

解决方案

The HTML5 document does mention it in the section you link above:

Content model

Flow content, but with no form element descendants.

"Content model" means "what this element may contain". So no, nested forms are not allowed.

这篇关于嵌套表单在HTML5中是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆