In the script below, the reset button acts also like a submit button. Where could the problem be? Thanks.
HTML
<input type="image" name="submit" value=" " src="image.png">
<input type="image" name="reset" value=" " src="reset.png">
Thanks for your time.
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.
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.
Source: http://www.w3.org/TR/2012/WD-html-markup-20120329/input.image.html
To make a reset button you should use
<input type="reset" value="Reset">
with type="image"
acts like submit button.