I've created a form with 2 inputs and 2 buttons. The buttons are images, and as far as I know there's no way to say <input type="submit" src="image.gif"> - you have to say <input type="image" src="image.gif">
So I've got 2 inputs saying type=image src="reset.gif" and "submit.gif". On the reset button I've looped through the form elements and reset them back to "" and said return false so that the form doesn't get submitted. For some reason when I say input type="image" it automatically acts as a submit button. This is fine with me though. However, if I fill in the fields and press enter in IE, the form doesn't get submitted, it gets reset. The reset button definitely doesn't have focus at the time as it's tabindex is higher than the submit button's tabindex. Have i setup my buttons all wrong or ... ? Can somebody help me out here?
So I've got 2 inputs saying type=image src="reset.gif" and "submit.gif". On the reset button I've looped through the form elements and reset them back to "" and said return false so that the form doesn't get submitted. For some reason when I say input type="image" it automatically acts as a submit button. This is fine with me though. However, if I fill in the fields and press enter in IE, the form doesn't get submitted, it gets reset. The reset button definitely doesn't have focus at the time as it's tabindex is higher than the submit button's tabindex. Have i setup my buttons all wrong or ... ? Can somebody help me out here?