Re: form submission logic

From: Date: Fri, 07 May 2004 18:47:25 +0000
Subject: Re: form submission logic
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185666@lists.php.net to get a copy of this message
Well, I would include another hidden field and name it something like "ACTION". I would also include a checkbox on every item you want to do something with like this : <input type=checkbox name="item[]" value="<?=$databaseID?>"> Then use javascript on your actions to set the action to whatever mode you need, for example "delete". On the PHP side you get a very nice workflow now, as you will recieve an array on all the items which are selected and you can perform multiple tasks at once. Example, publish n articles in one go, or delete all at once. Remember to valiudate the $_POST["item"] as an array! Remember, all the values in this array will be the onces you should $_POST["action"]. Have fun! -- -- Kim Steinhaug ---------------------------------------------------------------------- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. ---------------------------------------------------------------------- www.steinhaug.com - www.easywebshop.no - www.webkitpro.com ---------------------------------------------------------------------- "Aaron Wolski" <aaronjw@martekbiz.com> wrote in message news:007e01c4345a$c23b3e60$6501a8c0@AJW2... > Hi all, > > Was wondering if someone had any idea's on this logic and if it'd work, > before I tried to implement it: > > Within the <form></form> tags I have my buttons - Publish, Unpublish, > New, Edit and Delete. > > Next I have a table of that displays a list of records from a database > with a checkbox to select a particular record. > > Once a record has been "selected" they click one of the top buttons to > perform their desired action. > > WILL this work OR do the buttons HAVE to go at the bottom? > > Thanks! Any help is appreciated. > > Regards, > > Aaron > >

« previous php.general (#185666) next »