tags:

views:

202

answers:

5

(This question is related to this question)

I've a simple form:

<html>
<head>
</head>
<body>
    <form name="aspnetForm" method="post" action="http://www.startupseeds.com/Default.aspx"&gt;
        <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>

When I Change this:

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

to this:

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

...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?

Thank you.

A: 

need the src attribute that point a image url...

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

EDIT:http://www.w3schools.com/TAGS/att_input_type.asp

defines an image as a submit button.

The src and alt attribute are required with .

Angelbit
His question is the other way round..
BalusC
ops, true...sorry :)
Angelbit
A: 

A submit button created using is rather a drab looking gray colored entity, unless you know style sheets. while By placing input type=image in place of input type=submit you can place an image in place of the default submit button. as example shown

< input type="image" src="images/submit.jpg" value="Submit" alt="Submit" >

GK
A: 

I suspect you'd like an asp.net page like this:

<form id="form1" runat="server" action="http://www.startupseeds.com/Default.aspx"&gt;
<div>
    <asp:TextBox ID="tbTextBox" runat="server" />
    <asp:TextBox ID="tbPassWord" runat="server" TextMode="Password" />
    <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
</div>
</form>

However, it depends on your target site if this kind of http-post actions are allowed.

Webleeuw
A: 

Most likely your backend code is checking for the existence of an ibLogin.x or ibLogin.y POST parameters which are sent when you click an <input type="image"> and represent the coordinates of the click. An <input type="submit">, on the other hand, will post an ibLogin parameter.

Max Shawabkeh
+2  A: 

The difference is that:

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

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.

From 17.4.1 Control types created with INPUT of the HTML 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.

cletus
...and this fails in ASP.NET because it doesn't expect those parameter names back. To cover this, just use `input type="submit"` with a CSS background image. You also apparently don't need an image map, but *just* a button with a background image.
BalusC
@BalusC: can't ASP.NET handle image maps? Or is there some explicit mechanism that ends up using `usemap`?
cletus
I should have been less generic. I actually meant the code behind the form action.
BalusC
I added two hidden inputs `ctl00$Login1$ibLogin.x` and `ctl00$Login1$ibLogin.y` and it is works now! Thank you!
TTT