[Typo3] piVars with select multiple

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


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