【发布时间】:2013-05-05 18:10:52
【问题描述】:
通常,提交按钮在没有name 属性的情况下也能正常工作。但是,在某些情况下,同一个表单需要有两个提交按钮,因此使用name 属性来识别在服务器端单击了哪个按钮。
澄清一下我说的是:<input type="submit" name="foo">
【问题讨论】:
标签: html coding-style standards w3c-validation
通常,提交按钮在没有name 属性的情况下也能正常工作。但是,在某些情况下,同一个表单需要有两个提交按钮,因此使用name 属性来识别在服务器端单击了哪个按钮。
澄清一下我说的是:<input type="submit" name="foo">
【问题讨论】:
标签: html coding-style standards w3c-validation
是的,完全可以接受。
规范has explicit rules for how to determine which submit button was successful,如果你不能给元素一个名字,这将是无用的。
【讨论】: