具有多个同名隐藏控件元素的 HTML 表单 [英] HTML form with multiple hidden control elements of the same name

查看:36
本文介绍了具有多个同名隐藏控件元素的 HTML 表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拥有一个包含多个同名隐藏"控制元素的 HTML 表单是否合法?我希望在服务器上获得所有这些元素的值.如果合法,主要浏览器是否正确实现了该行为?

Is it legal to have an HTML form with more than one "hidden" control element with the same name? I expect to get the values of all of these elements at the server. If it is legal, do the major browsers implement the behavior correctly?

推荐答案

浏览器可以接受.但是,应用程序库解析它的方式可能会有所不同.

The browsers are OK with it. However, how the application library parses it may vary.

程序应该将同名的项目组合在一起.虽然 HTML 规范没有明确说明这一点,但它在 有关复选框的文档:

Programs are supposed to group identically named items together. While the HTML specification doesn't explicitly say this, it is implicitly stated in the documentation on checkboxes:

表单中的多个复选框可以共享相同的控件名称.因此,对于例如,复选框允许用户为同一个选择多个值财产.

Several checkboxes in a form may share the same control name. Thus, for example, checkboxes allow users to select several values for the same property.

这篇关于具有多个同名隐藏控件元素的 HTML 表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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