Sumbit button as normal link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwfait
Forum Contributor
Posts: 113
Joined: Sun Aug 01, 2004 10:36 pm

Sumbit button as normal link

Post by dwfait »

Hi. How would you make a normal a href link be a submit button in a form?

EDIT: or a submit button as an image or text?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

dwfait
Forum Contributor
Posts: 113
Joined: Sun Aug 01, 2004 10:36 pm

Post by dwfait »

i dont think thats quite what i want...

What i need is:

An image, in a form, to act as the submit button.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

that's for your first part.. the image buttons.. are standard html.. form images.. I believe a search engine will find that information for you.
dwfait
Forum Contributor
Posts: 113
Joined: Sun Aug 01, 2004 10:36 pm

Post by dwfait »

I think ill stick to submit buttons then, lol, thanks anyway.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

try this:

Code: Select all

<input type=image src=whatever.jpg>
http://www.codetoad.com/html/buttons/im ... button.asp
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

and if you want jsut a text link to submit, you can do

Code: Select all

<a href="#" onclick="javascript:document.formname.submit();">Submit</a>
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

To use an image as a submit button:

Code: Select all

&lt;input type=image src="okay.gif" name="Okay"&gt;
The submission sends two $_POST (or $_GET) vars: Okay_x and Okay_y which indicate the coordinates within the image at which the button was clicked, so you need to check for the button like:

Code: Select all

<?php
if (isset($_POST['Okay_x']))
?>
Post Reply