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

Replacing standard submit button with own image button.

Status
Not open for further replies.

lynxvoodoo

Technical User
Dec 28, 2002
14
GB
Hi! The following code produces a sumbit button which works. But my question is how can I replace the standard submit button to one of my own?

Dim strAction
strAction = UCase(Left(Request.Form("action"),8))
Select Case strAction
Case "CONTINUE"
Response.Redirect "default.asp"

....................
....................
....................

End Select


Response.write &quot;<input name=&quot;&q&&quot;action&quot;&q&&quot; type=&quot;&q&&quot;submit&quot;&q&&quot; value=&quot;&q&&quot;Continue&quot;& q &&quot;> 

I have tried to change type=&quot;image&quot; and included the follwoing scr=&quot;image.gif&quot;. The button images does appear but does not seem to do as its supposed to.

Help will be greatly appreciated.

Lynx [thumbsup]
 
try <input type=&quot;image&quot; src=&quot;image.gif&quot; onClick=&quot;this.form.submit();&quot;>



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Have tried the above but still get the same problem.

Have also tried by replacing onClick=&quot;this.form.submit();&quot;
with onClick=&quot;Submit&quot; but yet again still the same problem.

Does anyone have any suggestions.

Thanks in advance.

Lynx.
 
If its just an image that you want to be able to click then -

<a href=&quot; SRC=&quot;image.gif&quot; BORDER=&quot;0&quot;></A> Saturday 12.00
im6.gif
im2.gif
im2.gif
20.00
im5.gif
im4.gif
im7.gif
3.00am
im8.gif
Sunday [img http
 
I would write an href with a javascript to submit the form...

<a href=&quot;javascript: document.myForm.submit()&quot; border=0>
<img src=&quot;myButton.gif&quot;>
</a> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
 
You don't need to specify any onClick event for an image input - it automatically acts as a submit button:

Code:
<form action=&quot;page2.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;txt1&quot;>
<input type=&quot;image&quot; src=&quot;images/submit.gif&quot;>
</form>

More info:
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top