input type=submit 的小问题

以前使用strtus2时,在jsp页面中有input时要去name才可以保证数据不会被提交到服务器,一直没有弄明白为什么会这样的,看到一段解释明白了。

HTML元素 - input type=submit
定义
创建一个按钮,点击该按钮后,即提交表单。
Creates a button that, when clicked, submits the form.
注释
使用 VALUE 标签属性将创建无法由用户编辑的显示标签。默认的文字是 Submit Query。如果用户单击提交按钮提交了表单,并且按钮指定了 name 标签属性,那么该按钮也将以 name/value 方式成对提交。
如果 INPUT type=submit 元素是 FORM 元素的一部分,则该按钮将以粗边框显示,这代表着用户按回车就可提交表单。
如果在同一表单中有多个 INPUT type=submit 按钮,按回车键将使用第一个 INPUT type=submit 按钮提交表单,除非此时正有另一个 INPUT type=submit 按钮获得了焦点。如果另外一个 INPUT type=submit 按钮已获得焦点,按回车键将使用获得焦点的 INPUT type=submit 按钮提交表单。
此元素在 Internet Explorer 3.0 及以上版本的 HTML 和脚本中可用。
此元素是一个内嵌元素。
此元素不需要关闭标签。
Use the VALUE attribute to create a button with a display label that cannot be edited by the user. The default label is Submit Query. If the user clicks the Submit button to submit the form, and that button has a name attribute specified, that button contributes a name/value pair to the submitted data.
If the INPUT type=submit element is part of a FORM element, it appears as a button with a dark border, which indicates the user can press ENTER to submit the form.
When there is more than one INPUT type=submit in the same form, pressing enter submits the form using the first INPUT type=submit, unless another INPUT type=submit has focus. When another INPUT type=submit has focus, pressing enter submits the form using that INPUT type=submit.
The INPUT type=submit element is available in HTML and script as of Internet Explorer 3.0.
This element is an inline element.
This element does not require a closing tag.

转载于:https://my.oschina.net/doz/blog/144972

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值