HTML form with multiple hidden control elements of the same name

前端 未结 8 2108
-上瘾入骨i
-上瘾入骨i 2020-11-27 06:14

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 i

8条回答
  •  广开言路
    2020-11-27 06:52

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

    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.

提交回复
热议问题