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

查看:156
本文介绍了具有相同名称的多个隐藏控件元素的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天全站免登陆