Skip to main content

3. 表单和表单处理的建议 (Advice for Forms and Form Processing)

3. 表单和表单处理的建议 (Advice for Forms and Form Processing)

🇬🇧 英文原文

The representation and interpretation of forms and the nature of form processing is not specified by this document. However, for forms and form processing that result in the generation of multipart/form-data, some suggestions are included.

In a form, there is generally a sequence of fields, where each field is expected to be supplied with a value, e.g., by a user who fills out the form. Each field has a name. After a form has been filled out and the form's data is "submitted", the form processing results in a set of values for each field -- the "form data".

In forms that work with multipart/form-data, field names could be arbitrary Unicode strings; however, restricting field names to ASCII will help avoid some interoperability issues (see Section 5.1).

Within a given form, ensuring field names are unique is also helpful. Some fields may have default values or presupplied values in the form itself. Fields with presupplied values might be hidden or invisible; this allows using generic processing for form data from a variety of actual forms.


🇨🇳 中文翻译

本文档未指定表单的表示和解释以及表单处理的性质。然而,对于生成 multipart/form-data 的表单和表单处理,包含了一些建议。

在一个表单中,通常有一系列字段,每个字段预期被提供一个值,例如,由填写表单的用户提供。每个字段都有一个名称。在表单被填写完成并且表单数据被"提交"后,表单处理会为每个字段生成一组值 -- 即"表单数据"。

在使用 multipart/form-data 的表单中,字段名称可以是任意的 Unicode 字符串; 然而,将字段名称限制为 ASCII 将有助于避免一些互操作性问题(参见第 5.1 节)。

在给定的表单中,确保字段名称是唯一的也很有帮助。某些字段可能在表单本身中具有默认值或预提供的值。具有预提供值的字段可能是隐藏的或不可见的; 这允许对来自各种实际表单的表单数据使用通用处理。