RE: [PHP] populate form input option dropdown box from existingdata

From: Date: Tue, 16 Jun 2009 18:42:02 +0000
Subject: RE: [PHP] populate form input option dropdown box from existingdata
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-294119@lists.php.net to get a copy of this message
Ack, yes - my bad. Missed the select name square brackets when I sent my example. And yeah, the only real difference between a multiple select and checkbox is which works best with the UI (and, more often than not, how confused the concept of multiple selects makes your end-user) -- for (thoughts, ramblings && doodles) { goto http://dajve.co.uk ; } > -----Original Message----- > From: tedd [mailto:tedd.sperling@gmail.com] > Sent: 16 June 2009 19:05 > To: php-general@lists.php.net > Subject: Re: [PHP] populate form input option dropdown box from > existingdata > > At 10:42 AM -0500 6/16/09, Shawn McKenzie wrote: > >He has a multiple select, so the select has to be an array or you just > >get one value even if more than one was selected (you just get the last > >one). > > Okay, it's not that much different than using check-boxes -- here's > the solution for that: > > http://www.webbytedd.com/bbb/check-box-form/index.php > > and here's the select solution: > > http://www.webbytedd.com/bbb/select-box-form/index.php > > The point is to use name="option[]" (i.e., name the array) and allow > the browser to populate the POST array. Then on the php side of > things, simply pull out the data from the POST array via the array's > name. > > You can see how this is done via the above links. > > Cheers, > > tedd > > -- > ------- > http://sperling.com > http://ancientstones.com > http://earthstones.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#294119) next »