[Typo3] piVars with select multiple

Raphael GEYER typo3 at ameos.com
Thu Jun 9 17:53:47 CEST 2005


Thanks Joshua,

I also found the additional set of brackets in another source code.
Seems to be be the best way or ?

Raphael GEYER
http://www.ameos.com


"Joshua Preston" <jpreston at americatab.com> a écrit dans le message de news: 
mailman.2785.1118331808.19958.typo3-english at lists.netfielders.de...
> Raphael,
>
> Hey!
>
> I wouldn't say that this is the correct way, but I add an additional set
> of brackets on the name.  Then I access piVars['name'] as an array.  For
> me it's easier.
>
> IE:
>
> $out .= '
>        <select name="' . $this->prefixId . '[multiselect][]" multiple>
>          <option value="1">first value</option>
>          <option value="2">another value</option>
>          <option value="3">third value</option>
>          <option value="4">fourth value</option>
>          <option value="5">fifth value</option>
>       </select>
> ';
>
> ...
> ...
>
> foreach ( $this->piVars['multiselect'] as $key => $value ) {
>    $out .= '<p>' . $key . '=' . $value . '</p>';
> }
>
>
> However, this may not be the best way ;-)
>
> Thanks!
>
> Joshua Preston.
>
> Raphael GEYER wrote:
>
>>Hi list,
>>
>>What is the right way to retrive several values with piVars and a <select
>>name="..." multiple>...</select>
>>
>>Raphael GEYER
>>http://www.ameos.com
>>
>>
>>
>>_______________________________________________
>>Typo3-english mailing list
>>Typo3-english at lists.netfielders.de
>>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>>
>>
>
> -- 
> "Programming today is a race between software engineers
> striving to build bigger and better idiot-proof programs,
> and the Universe trying to produce bigger and better idiots.
> So far, the Universe is winning."
>
> -- Rich Cook.
>
> 





More information about the TYPO3-english mailing list