PDA

View Full Version : Using an image as a submit button and a hyperlink.


PWJ
08-26-2002, 07:48 PM
I would like to use an image as a form submit button and a hyperlink. At the moment, I can only get the image to work solely as a submit button or as a hyperlink, but not both at the same time. Can anyone tell me if this dual action is possible and if so be kind enough to suggest some code?

Cheers,

PJ.

ACJavascript
08-26-2002, 08:15 PM
Try this (I didn't even test this so it might just fail miserably:D)

_________

<form onSubmit="javascript:location.href='http://www.whereever.com';">

<input type="text" name="bla">

<input type="submit">

</form>

allida77
08-26-2002, 08:55 PM
Why do you want this dual action?:confused:

duniyadnd
08-26-2002, 09:01 PM
A link to what you want (explains a bit of it too, so thought it would be better to just give the link):

http://javascript.about.com/library/scripts/blimagesubmit.htm

Duniyadnd

PWJ
08-26-2002, 09:40 PM
Hmm... I think i've left out some vital information......

The idea is to collect a name, e-mail and an answer to a question using a form. This data then needs to be submitted to myself via e-mail on clicking of an advertising banner. However, on submitting I need the user to be shown some sort of "thank you" page as well as a new window to open containing the web site of the advert.

The aim is to set a competition within a univerity community in order to generate advertising revenues which will help fund a club.

Thanks for such rapid replies though:thumbsup: