Kapusta
asked on
Form button with image and reset?
Could someone provide HTML code that uses a form in which exists an input field (where the user can type) plus two images which will serve as buttons. One image will be "Reset" and the other image will be "Submit". I do not want to see the standard gray rectangular buttons...instead, I want to replaced them with images.
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So I take it that it is impossible to have an Image button perform a Reset without using Javascript?
I had hoped to avoid Javascript.
I had hoped to avoid Javascript.
Sorry, not possible:( Why hope to avoid JavaScript though? It's very commonly supported by the browsers. I believe the code used in this question is 1.0, so that means Netscape 2.0+ and IE 3.0+. That's pretty good support, and few people disable JavaScript anymore, because so many pages rely on it and don't function at all without it... It's not really something you have to worry about anymore.
-Josh
-Josh
To have an image for submit and reload, you first will need the images you want to use. Then use the input type "image" as I've done above. When the user clicks on this image it submits the form and sends the coordinates of where the user clicked on the image. This data will probably be meaningless for you so you can just ignore it... To do a reset with a custom image though requires a little javascript... You can use the input type "image" like I did above, or even just a normal img tag:
<A HREF="JavaScript:;" onClick="document.theForm.
Either way it will reset the form...
Oh, and similarly you can submit the form with a normal image tag if you use javascript. The same as above, with reset changed to submit:
<A HREF="JavaScript:;" onClick="document.theForm.
Either way, its up to you...
If you have any further question on this, feel free to ask.
-Josh