Re: form submission logic

From: Date: Fri, 07 May 2004 20:40:59 +0000
Subject: Re: form submission logic
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-185686@lists.php.net to get a copy of this message
"Kim Steinhaug" <kim@steinhaug.com> wrote in message news:20040507202633.75189.qmail@pb1.pair.com... > I dont agree however, if your creating a system which should be > user friendly I would absolutely demand from my users to have JS > enabled. This is only possible in a non-public application. > > If they dont have JS enabled, then -> well, to bad for them... > > We have created several web applications and have alot of > customers (B2B), and they have all JS enabled. The friendslyness > and functionality you can do with JS makes the total experience > far better than not using JS. And you alse can save alot of reloading > of the pages with confirmation dialogs and such. I agree with you that it *may* improve usability - but in Aaron's case it is of no interest to the user how the application prepares and checks the form actions - and this can be done perfectly without JS here. Also - and you can't deny this - Javascript always adds a bit of uncertainty as not all browsers interpret every function in the same way. > > Anyway, its all a matter of opinion. Absolutely ;) I just wanted to tell Aaron that a more complicated/sophisticated way is not always better and to carefully balance if Javascript is *really* need here. No offence to you, though... Torsten > > -- > -- > 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 > ---------------------------------------------------------------------- > > "Torsten Roehr" <roehr@zilleon.com> wrote in message > news:20040507191111.43314.qmail@pb1.pair.com... > > "Kim Steinhaug" <kim@steinhaug.com> wrote in message > > news:20040507184458.23039.qmail@pb1.pair.com... > > > 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. > > > > I would not recommend using Javascript here because then you are reliant > on > > the client having JS enabled. Just use different names for your submit > > buttons and then check them: > > > > if (isset($_POST['new'])) { > > ... > > } elseif (isset($_POST['delete'])) { > > ... > > } > > > > ...and so on > > > > Regards, Torsten > > > > > > > > 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 (#185686) next »