[Typo3] piVars with select multiple

Joshua Preston jpreston at americatab.com
Thu Jun 9 17:44:14 CEST 2005



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.


$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>


foreach ( $this->piVars['multiselect'] as $key => $value ) {
    $out .= '<p>' . $key . '=' . $value . '</p>';

However, this may not be the best way ;-)


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
>Typo3-english mailing list
>Typo3-english at lists.netfielders.de

"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