我应该使用 <field> 而不是 <input> 标签进行输入吗?

Should I be using <field> instead of <input> tags for input?

我对这里的 Joomla 文档感到困惑后问了这个问题:https://docs.joomla.org/Client-side_form_validation

看起来他们使用的是 <field> 标签,而我通常会使用 <input> 标签。我搜索了 w3.org 并查看了 HTML5 的规范,但找不到任何提及 'field' 标签的内容。

我知道 <field> 在 XML 上下文中完全有效,只是不确定为什么他们用它代替 <input> 我认为 [=26] =] 表格。

表单字段是 HTML 中的字段。 Joomla 2.5 及更新版本提供了 JForm class 以方便灵活地创建具有大量表单字段的表单。每个表单字段类型都是 JFormField.

的子class

您可以阅读有关 Tag form field type

的更多信息

html 中没有字段标签,因为字段标签对 joomla 来说很特别

来自文档

Form fields are fields in a HTML . Joomla! 2.5 and newer supply the JForm class to conveniently and flexibly create forms with a large amount of form fields. Each form field type is a subclass of JFormField.

In addition to being a flexible page creation tool, JFormFields are used by Joomla! to allow administrators to configure Joomla! or its extensions without changing the underlying code. In Joomla! 1.5, this was handled by the now deprecated JParameter and JElement classes.

To define form fields in the configuration of an extension, you must include them in a named fieldset, such as , that is within the section of the element in your XML manifest file.

从这里阅读更多内容

https://docs.joomla.org/Form_field