I currently have an input with a button type but i wanted to change how the button looks to match the rest of my web page buttons but i am having problems:
This input works like it should but doesn’t show the image i want it to show for the button:
<input type="button" src="<%:Url.Content("~/Content/images/newCancel.png")%>" onclick="goBack()"/>
This shows the image but doesn’t function like it should – it doesn’t execute the javascript:
<input type="image" src="<%:Url.Content("~/Content/images/newCancel.png")%>" onclick="goBack()"/>
Any help will be great
An input with a type of image submits the form. Put a “return false;” at the end of the onclick and it should prevent the form’s submit.
Alternatively, you could just create the image and add the event directly to the image.