problem posting select option to a script

Hi,
I am using the following on a form

<select tabindex="6" multiple="multiple" size="4" name="area">
          <option value="11">Nationwide</option>
          <option value="12">United Kingdom</option>
          <option value="13">International</option>
        </select>

but when select multiple options only the last selected option is posted?
markmchughAsked:
Who is Participating?
 
hieloConnect With a Mentor Commented:
Add brackets to the name of the select:
<select tabindex="6" multiple="multiple" size="4" name="area[]">
          <option value="11">Nationwide</option>
          <option value="12">United Kingdom</option>
          <option value="13">International</option>
        </select>

On the server you retrieve it as:
$selectionArray = $_REQUEST['area'];

foreach( $selectionArray as $key => $val)
{
 echo($key . " == " . $val);
}
0
All Courses

From novice to tech pro — start learning today.