Posting and validating multiple select

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gnawz
    New Member
    • Nov 2006
    • 64

    #1

    Posting and validating multiple select

    i have a multiple drop down with five items..

    If i select 2 or more items and post, only one item is posted to the db!
    How do I make it post all the fields I have selected?


    The HTML list

    <select name="txtservic e" size="3" id="txtservice " multiple>
    <option value="1">Wrapp ing and Storage</option>
    <option value="2">Logis tics and warehousing supervision </option>
    <option value="3">Loadi ng and Unloading</option>
    <option value="4">Packi ng and Labelling</option>
    </select>

    PHP for getting variable

    $service = $_POST["txtservice "];

    And how can I validate this multiple select?
Working...