【问题标题】:Is it acceptable for a submit button to have a name attribute?提交按钮具有名称属性是否可以接受?
【发布时间】:2013-05-05 18:10:52
【问题描述】:

通常,提交按钮在没有name 属性的情况下也能正常工作。但是,在某些情况下,同一个表单需要有两个提交按钮,因此使用name 属性来识别在服务器端单击了哪个按钮。

澄清一下我说的是:<input type="submit" name="foo">

【问题讨论】:

    标签: html coding-style standards w3c-validation


    【解决方案1】:

    是的,完全可以接受。

    规范has explicit rules for how to determine which submit button was successful,如果你不能给元素一个名字,这将是无用的。

    【讨论】:

      猜你喜欢
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 2012-10-02
      • 2011-06-30
      • 2020-12-04
      • 2014-08-09
      • 1970-01-01
      • 2013-01-30
      相关资源
      最近更新 更多