gpt4 book ai didi

html - 类型 ="image"和类型 ="submit"之间的区别?

转载 作者:可可西里 更新时间:2023-11-01 16:47:09 26 4
gpt4 key购买 nike

(这个问题与this question有关)

我有一个简单的表单:

<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 中的键/值中)- 我怎样才能让“提交”工作?

谢谢。

最佳答案

区别在于:

<input type="image" name="ctl00$Login1$ibLogin" />

将产生两个表单字段:ctl00$Login1$ibLogin.xctl00$Login1$ibLogin.y 以指示图像的哪一部分被点击,尽管您的标记中没有图像。

来自 17.4.1 Control types created with INPUTHTML 4.01 Specification :

image

Creates a graphical submit button. The value of the src attribute specifies the URI of the image that will decorate the button. For accessibility reasons, authors should provide alternate text for the image via the alt attribute.

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.

关于html - 类型 ="image"和类型 ="submit"之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2082005/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com