html - HTML 表单提交标签之间的区别

标签 html

据我所知,提交 HTML 表单的方法有以下三种,无需 JS 或键盘:

1. input type=submit
2. button tag
3. input type=image

是否有另一种方法可以创建一个在按下时提交表单的元素? 处理与输入类型=提交相同的按钮标签(类型=提交)是否正确(我的意思是,如果我们放弃按钮可以包含内部 html 的事实,我们可以简单地将 button 替换为 input type="submit" 并且表单将被正确发送)? 添加 name.x 和 name.y 是使用 input type=image 时的唯一区别吗?

最佳答案

  1. Not that I know of, those should be the only pure html ways to submit the form other than directly invoking the submit method which is internal Javascript, but that is what the submit button does anyway.
  2. The button element has issues in Internet Explorer regarding which value it passes, I do not recommend the use of it.
  3. Yes, they're pretty much the same
  4. As far as I know input type=image is exactly the same except that it sends those extra coordinate parameters which you can ignore on the server-side.

关于html - HTML 表单提交标签之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1484152/

相关文章:

html - 使用 bootstrap 在菜单中下拉

html - 固定页脚覆盖内容

javascript - 提取多个同名的div标签

html - 对齐 + 和 - 用于购物篮增量器

html - Internet Explorer 7 float 列表元素

html - 将六列 flex 布局转换为三列

html - 主题字体不适用于段落

html - CSS 菜单(无法让标签达到全高)

html - HTML 电子邮件中的字体和下划线问题

javascript - .hasClass() 忘记了类分配。为什么?