PDA

View Full Version : Linking a button


isapiens
06-25-2006, 09:47 PM
Hi. I have created a button using a form. Now i want to link it to another page. Do i have to use javascript or css to do that? Is there a way to do this purily with html. I dont want to use an image instead of the "form' button.
tx in advance guys

erisco
06-25-2006, 10:44 PM
You can tell where the button goes to with the form action, and as far as using a custom image for the button...
<input type="image" name="submit" src="image.jpg" width="126" height="18">
Should give you a lead on that.

Edit... oops my bad, you DIDN'T want an image. Heh, oh well.

Geoserv
06-26-2006, 07:17 AM
You can put a redirect command in, so that when the visitor clicks your image it takes them to what ever page you specify.


<input type=hidden name="redirect" value="http://your.host.com/to/file.html">


Geoserv.

_Aerospace_Eng_
06-26-2006, 07:24 AM
There is no such thing as a "redirect command". You will need JS if you prefer to use a button.
<input type="button" value="go" onclick="window.location = 'somepage.html'">

Geoserv
06-26-2006, 07:52 AM
There is no such thing as a "redirect command". You will need JS if you prefer to use a button.
<input type="button" value="go" onclick="window.location = 'somepage.html'">

Really?

Strange, since the author of FormMail says there is. I use it on my forms and it works, so I'm assuming it exists. ;)

http://www.scriptarchive.com/readme/formmail.html#redirect

Can you explain Aero what you mean?

Geoserv.

_Aerospace_Eng_
06-26-2006, 07:54 AM
Yeah if you were actually using FormMail but the OP says no where in his/her post that they are using FormMail. They just say they are using a form. The FormMail script is setup to accept the hidden input with name="redirect" as a post variable.

Geoserv
06-26-2006, 07:57 AM
Ok, that sounds better.

I just wanted to clear up that the command does exist.

Thanks,
Geoserv.

isapiens
06-26-2006, 01:47 PM
Thanks guys:) I figured u have to use JS cuz nothing came up in my search. I was just thinking why cant u put anything between <href a> and make it a link. Kind of weird but whatev.

lzhang
06-27-2006, 03:40 PM
Hi, _Arospace_eng_

This will go to another page directly.

<input type="button" value="go" onclick="window.location = 'somepage.html'">

What if we want to process some codes before redirect to "somepage.html"