Re: QF: setMultiple changes the name of my select
| From: | Derek Downey | Date: | Fri, 10 Mar 2006 16:14:56 +0000 |
| Subject: | Re: QF: setMultiple changes the name of my select | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23264@lists.php.net to get a copy of this message | ||
I'm confused...why do you want to remove [] w/ a multiple select?
I was under the impression that to retrieve the data from a multiple select
on a form submission (at least for POST) the POST variable had to be an
array like this.
If you remove the [], can you retrieve the multiple selections?
Derek
On 3/10/06 8:10 AM, "Damien Cros" <damienc@cc.in2p3.fr> wrote:
> Hi,
>
> Here's my problem:
>
> $myselect = $form->addElement('select', 'myselect', null, null)
> generates <select name="myselect"></select>
>
>
> whereas
> $myselect = $form->addElement('select', 'myselect', null, null);
> $myselect-> setMultiple(TRUE);
>
> generates <select name="myselect[]"
> multiple="multiple"></select>
>
> I'd like to remove the [] in the generated name, how can I do that?
>
> bye,
> damien