Re: how to :: multi select

From: Date: Fri, 04 Jul 2003 14:01:33 +0000
Subject: Re: how to :: multi select
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-154015@lists.php.net to get a copy of this message
Hi Thomas. You need to name each checkbox a different name. alternatively, you can name them with array naming convention. i.e. <input type=checkbox name='array1[value1]' value='Y'> 1-1 <input type=checkbox name='array1[value2]' value='Y'> 1-2 <input type=checkbox name='array2[value1]' value='Y'> 2-1 <input type=checkbox name='array2[value2]' value='Y'> 2-2 Checking off 1-1 and 2-2 would create the following variables (assuming register_globals is on) in the target php script for the form: $array1=array("value1"=>"Y","value2"=>""); $array2=array("value1"=>"","value2"=>"Y"); Hope this helps Matt On Fri, 2003-07-04 at 17:20, Thomas Hochstetter wrote: > Hi guys, > > This might just be off the topic, but here it goes anyway: > > How can one multi select check boxes and pass them through in php, > without getting mixed up with variables (email multi select style). > > Thomas

« previous php.general (#154015) next »