Display a jpeg image instead of a submit button in a form

Hi, how can the code below be changed so that instead of a button being used to submit the form, a jpeg image is used. Thanks

 <td align="right"><font face="Arial Narrow" size="5"><input type=
 "submit" value="       Search       "></font></td>
</tr>

OsdNAAsked:
Who is Participating?
 
RoonaanConnect With a Mentor Commented:
<td align="right"><input type="image" src="somejpeg.jpg" onClick="this.form.submit();" /></td>
0
 
ZylochCommented:
Hey, Roonaan should get the points for this, I'm just pointing out something that's been bugging me a bit. I've seen a lot of people use onClick and it's perfect fine and works like a charm but people should really get in the habit of using onclick instead of onClick or onmouseout instead of onMouseOut because believe it or not, XHTML actually requires all lowercase. (Don't pay attention to this and take it personally, I'm just letting out tons of pent out anger from the day)
0
 
RoonaanCommented:
Zyloch, I'm a bit ashamed. I should've know this, last week when I was trying to xhtml-validator some subsite. *roonaan slams his head against ten tons of concrete*. Stupid not to think of that. I just changed the doctype to 4.01.

Thx to have someone with a clear vision on things. Quite the wakeupcall I needed!

damn.

*mumbles along*

-r-

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
ZylochCommented:
Heh, wasn't really aimed at you, but it's a good "little" thing to know

Regards...
0
 
OsdNAAuthor Commented:
Thanks, how can I amend the size of the image?
0
 
RoonaanCommented:
No I just felt stupid for not realizing this could be the cause for my afternoon trying to figure out why my site wouldn't validate.

You know that feeling when you waist a lot of time not being succesful in finishing things and then a week after, a gigant lightning strikes you, bringing clearvoiance etc.

This is one of those situations. And I'm glad it's finaly here, because hell no i aint forgetting this for a while, which is a very good thing!

-r-
0
 
ZylochConnect With a Mentor Commented:
You could either use someting like this:

<input type="image" src="hi.gif" width="200" height="200">

or

<input type="image" src="hi.gif" style="width:200px;height:200px;">
0
 
ZylochCommented:
OsdNA, I hope you don't mind if we're slightly conversational and off topic in your post, mainly my fault.
0
 
COBOLdinosaurCommented:
Actually the onclick is unnecessary.  type="image" has exactly the same behaviour as type="submit" which is to submit the form when it is clicked.  Good point Zyloch.  I let you promote that one while Sean and I continue the fight to end the use of tables for layout.:^)

Cd&
0
 
OsdNAAuthor Commented:

Thanks for all the help guys :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.