Jump to content

How to make a submit button a link


OriginalSunny

Recommended Posts

Hi,
instead of having the standard link (blue text underlined) i want to make a link to another page using a submit button. The code i have used for the button is below.

[i]echo "<tr>
<td colspan='2'> <input type='submit'
value='Return to orders menu'></td>\n";[/i]

As you can see this will not actually do anything except display the button. The question is how do i make this into a link? (I have used this code on my [i].php[/i] page and am not reading anything in from a [i].ini[/i] page and hopefully wont have to unless i need to).
Thanks.
Link to comment
Share on other sites

You have to put it inside a form and set the 'action' attribute of the form to the url you want. BUT WHY????

all that hassel just for a link and you aren't even sending any data! I'd just use an image for the link if you don't want the 'plain' text or better still use css well and create a funky link! Latter is much better for accessibility!
Link to comment
Share on other sites

I would suggest using images for the simple fact that some people turn javascript off in their browser and using a form for each link in your site just leads to lots of superfluous code. Then of course the obvious question is, do you have any idea of the capability of CSS in this matter? You do know that the text does not have to be underlined or blue, right? You can even make the background behind it change colors.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.