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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUBMIT on a .gif?

Status
Not open for further replies.

ghorr

Programmer
Sep 16, 2002
29
RO
i need a .gif to perform as a submit button...
cand i use style somehow to make a submit button look like a .gif ?
 
You'll need to throw in some javascript. Instead of a submit button, do something like this:
Code:
<form name='myform'>
...
<a href='javascript:document.myform.submit()'><img src=&quot;your.gif&quot;></a>

You can name your form something other than 'myform'.

Kevin
A+, Network+, MCP
 
I want the submit button to have a name..
How can i send the name of the submit button with this
method?
 
<img src=&quot;your.gif&quot; name=&quot;img1&quot;>

Known is handfull, Unknown is worldfull
 
...<img src=&quot;your.gif&quot; name=&quot;img1&quot;>

it is not working..:(
 
DON'T do it with Javascript - not everyone has it switched on when browsing, and such people won't be able to use your form.

Instead, use an image control:
[tt]
<input type=&quot;image&quot; src=&quot;submit.gif&quot; name=&quot;submit&quot;>
[/tt]
Note that this won't return a value in the &quot;submit&quot; parameter, the same way that this tag would:
[tt]
<input type=&quot;submit&quot; name=&quot;submit&quot;>
[/tt]
What it does return is values in parameters &quot;submit.x&quot; and &quot;submit.y&quot; that indicate where on the image the user clicked. You probably won't care, but a check to see if, say, &quot;submit.x&quot; has a value will tell you if that particular image was clicked.

-- Chris Hunt
 
I should have done more research. I also found out you can do this:
Code:
<button type=&quot;submit&quot; name=&quot;somename&quot;>
  <img src=&quot;yourimage.gif&quot;>
</button>
I don't know how compatible this method is, but it works in IE6 and Mozilla.

Kevin
A+, Network+, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top