Reset button acting like the submit button

Go To


In the script below, the reset button acts also like a submit button. Where could the problem be? Thanks.


  <input type="image" name="submit" value=" " src="image.png">
  <input type="image" name="reset" value=" " src="reset.png">

Thanks for your time.

2012-04-03 21:21
by NoName
As an aside, reset buttons on forms are so 1990's. Take a look at this article: and consider not including this clunky thing on your form to start with : - Chris Baker 2012-04-03 21:27


Inputs of type image always act like submit buttons.

You can use JavaScript to override the default behaviour, but if the user does not have JavaScript enabled, the button will submit instead of reset.

An option would be to add a regular reset typed button and replace that with an image or image typed input with JavaScript after DOM is loaded. This would make it work on browsers without JavaScript (they get the default reset button) as well as with JavaScript enabled.

2012-04-03 21:26
by Francisc


The problem is that by definition

<input type="image" />

defines submit button.

2012-04-03 21:26
by BluesRockAddict


That is the intended behavior.

The input element with a type attribute whose value is "image" represents either an image from which the UA enables a user to interactively select a pair of coordinates and submit the form, or alternatively a button from which the user can submit the form.


2012-04-03 21:26
by Tim Medora


To make a reset button you should use

<input type="reset" value="Reset">

with type="image" acts like submit button.

2012-04-03 21:29
by The Alpha