Accessing form values from multi selects or checkboxes

From: Date: Tue, 24 Aug 2004 10:00:23 +0000
Subject: Accessing form values from multi selects or checkboxes
Groups: php.general 
Request: Send a blank email to php-general+get-194556@lists.php.net to get a copy of this message
Hi, Is there a way I can access the values selected in a multi-select dropdown or group of checkboxes without appending square brackets to the name of the input field in my form so that it automatically becomes an array in PHP? i.e. rather than this: <select name="fruit[]" multiple size="5"><option value="apple">apple</option><option value="orange">orange</option></select> I would like to be able to do this, but still access the elements: <select name="fruit" multiple size="5"><option value="apple">apple</option><option value="orange">orange</option></select> Basically I am using a JavaScript chained select function which complains when I use square brackets in a field name, and before I start hacking the code I wanted to see if there was an alternative way of doing it server side. Thanks all, Alex --

« previous php.general (#194556) next »