Page 1 of 1

Form Button

Posted: Sun Apr 17, 2005 3:05 pm
by anthony88guy
I have my code display for example 20 items in rows. I want each row to have a update button that is linked to something like 'users.php?mode=whatever' How do make a button link to a page, I could always use an image. But just wondering. Do i have to make a whole <form> for each button?

Posted: Sun Apr 17, 2005 3:12 pm
by Cinder
I think you can use some JavaScript

Code: Select all

<script language=&quote;JavaScript&quote; type=&quote;text/javascript&quote;>
function Goto(value)
{
   window.laction=&quote;index.php?page=&quote;+url;
}
and then add:

Code: Select all

<input type=&quote;button&quote; onClick=&quote;item025&quote;>

Posted: Sun Apr 17, 2005 3:13 pm
by feyd
there are many ways. A form for each is one. A simple image linked is another. There are some variations that can do Javascripted stuff, but the basics remain the same. You set of the form to use that button as a submission in some fashion.

Posted: Mon Apr 18, 2005 5:01 am
by Phoenixheart
I encountered this before, and this is how I dealed: For each row I echoed:

Code: Select all

echo("<a href='deletepage.php?code=" .$row['CODE']. "' target=_blank><img source='delete.gif'></a>");
Then when you click on that "delete" image, it will open a new window that contains the file deletepage.php. This file will accept the code and then do deleting the product with that code.
I think your problem should be solved similiar. :wink:

Posted: Mon Apr 18, 2005 6:07 am
by anthony88guy
thxs, But thats how I am doing it, with images. :D