Re: Getting multitple select values on PHP side
| From: | Paul Novitski | Date: | Fri, 04 May 2007 22:34:38 +0000 |
| Subject: | Re: Getting multitple select values on PHP side | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254449@lists.php.net to get a copy of this message | ||
At 5/4/2007 01:56 PM, Skip Evans wrote:
I have a requirement for a select on a form that has to be able to get multiple values in the form processing PHP side. You just multiple to the <select...> tag to be able to select multiple values, but on the PHP side the $_POST value for the form only has the last one selected.I believe the common way to accomplish this is to add [] to the form element's name, which persuades PHP into treating it like an array:
<select name="nation[]" ...>Regards, Paul __________________________ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com