Page 1 of 1

Submitting data from a multipick list form field

Posted: Fri Jul 12, 2002 3:16 pm
by Matt Phelps
How do I do this? I want my user to be able to pick several things on a multipick list with either shift or control/click etc and then submit them. How do I get the information?

If the field name is 'listone' then if they only pick one item then that variable would be $listone but how about when they pick several items on the list?

Posted: Fri Jul 12, 2002 3:31 pm
by fatalcure
one way is:

Code: Select all

<SELECT NAME='testfield&#1111;]' size='8' multiple>
     <OPTION value='1'>1
     <OPTION value='2'>2
     <OPTION value='3'>3
     <OPTION value='4'>4
</SELECT>
Then when trying to find out what fields were selected use:

Code: Select all

<?php
     foreach ($HTTP_GET_VARS&#1111;"testfield"] as $testfield) &#123; 
          echo "$testfield<br>";
     &#125;
?>