type =" image&之间的差异并输入=" submit"? [英] Differences between type="image" and type="submit"?
问题描述
(此问题与此问题有关)
我有一个简单的表格:
<html>
<head>
</head>
<body>
<form name="aspnetForm" method="post" action="http://www.startupseeds.com/Default.aspx">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="..." />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWCALMyNWrBQKoz5H1CALlmOb9DgKmz6HzAwKf8bOXCQKC7qLKAwK5kNvVAQKk7amsA53tGBGr+Ji7LTI0eYkvquMZrF/g" />
<input name="ctl00$Login1$tbEmail" type="text" />
<input name="ctl00$Login1$tbPassword" type="password" />
<input type="image" name="ctl00$Login1$ibLogin" />
</form>
</body>
</html>
当我更改此信息时:
<input type="image" name="ctl00$Login1$ibLogin" />
到此:
<input type="submit" name="ctl00$Login1$ibLogin" />
...它不起作用。此代码的唯一区别是 type =submit
而不是 type =image
。我甚至不知道它们之间是否存在差异(在http中的键/值) - 如何让提交工作?
...it doesn't work. The only difference in this code is type="submit"
instead of type="image"
. I didn't know even that there are differences between them (in the key/value in http) - How can I get "submit" to work?
谢谢。
推荐答案
区别在于:
<input type="image" name="ctl00$Login1$ibLogin" />
将产生两个表单字段: ctl00 $ Login1 $ ibLogin.x
和 ctl00 $ Login1 $ ibLogin.y
表示单击图像的哪个部分,尽管标记中没有图像。
will result in two form fields: ctl00$Login1$ibLogin.x
and ctl00$Login1$ibLogin.y
to indicate what part of the image was clicked, although you have no image in your markup.
来自 17.4.1使用 HTML 4.01规范的INPUT 创建的控件类型:
From 17.4.1 Control types created with INPUT of the HTML 4.01 Specification:
图片
创建图形提交
按钮。
的价值 src
属性指定将装饰
按钮的图像的URI
。出于可访问性原因,
作者应提供 alternate $ b图片
alt 属性。
当指点设备用于
时点击图片,表格为
提交并且点击坐标
传递给服务器。 x值是
,用像素测量图像左边的
,以及图片顶部
像素的y值。
提交的数据包括name.x = x-value
和name.y = y-value其中name是名称的
属性,
值
x-value和y-value分别是x和y
坐标值。
When a pointing device is used to
click on the image, the form is
submitted and the click coordinates
passed to the server. The x value is
measured in pixels from the left
of the image, and the y value in
pixels from the top of the image. The
submitted data includes name.x=x-value
and name.y=y-value where "name" is the
value of the name
attribute, and
x-value and y-value are the x and y
coordinate values, respectively.
这篇关于type =" image&之间的差异并输入=" submit"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!