Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

? about forms and their buttons

Status
Not open for further replies.
Feb 3, 2003
28
0
0
US
If I'm using a form, how do I change the submit and reset buttons to a graphic I designed?
I saw a post on this subject when I wasn't looking for it and forgot to bookmark it. Now I need to know how and I can't find it.
 
a submit button can be done with just html like this:
Code:
<input type='image' src='yoursubmit.bmp' name='nameHere'>
the name is optional.
to create a reset button you have to use a little javascript:
Code:
<img src='resetButton.bmp' style="cursor:hand" onClick='document.yourFormNameHere.reset()'>

that should do it, hope it helps

"Whether you think that you can, or that you can't, you are usually right." - Henry Ford
 
Why not keep it standard? There's no need to mix methods of placing buttons on a form... Personally, I'd use the image input type for both buttons:

Code:
<input type="image" src="yourSubmit.gif">

<input type="image" src="yourReset.gif" onclick="this.form.reset();">

While the first button could have an onclick event:

Code:
<input type="image" src="yourSubmit.gif" onclick="this.form.submit();">

the submit event is the default for an input of type "image", so it is not stricly necessary to add it.

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top