title: Getting a id back from a datalist option form using php post.
body: <p>I am trying to use the datalist feature in html 5 in combination with php. So far it worked well, but i have run into a little problem.</p>
  
  <p>I want my $_POST['select'] to give me back my option id instead of my value (last names), because there could be more of the same last names.</p>
  
  <p>Any tips/hints in the right direction would be appreciated.</p>
  
  <p>My "form":</p>
  
  <pre><code>    &lt;form action="index.php?action=listcustomer" method="post" &gt;
        &lt;div class="ui action input"&gt;
          &lt;input type="text" name="select" placeholder="Zoek op achternaam"  autocomplete="on" list="datalistcustomer"&gt;
           &lt;datalist id="datalistcustomer"&gt; ';
            $sql = databaseConnect()-&gt;prepare("SELECT customerID, customerFirstName, customerLastName FROM customers ORDER BY customerLastName ASC");
            $sql-&gt;execute();
            $result = $sql-&gt;fetchAll(PDO::FETCH_ASSOC);
            foreach ($result as $key =&gt; $value) {
              echo '&lt;option id=' .$value['customerID'] .' value=' .$value['customerLastName'] .' label='.$value['customerFirstName'] .' &gt;    &lt;/option&gt;';
            }
  echo'       &lt;/datalist&gt;
            &lt;button type="submit" class="ui blue labeled icon button"&gt; &lt;i    class="user icon"&gt;&lt;/i&gt; Gaan &lt;/button&gt;
        &lt;/div&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>My Recieving end:</p>
  
  <pre><code>var_dump($_POST['select']);
  </code></pre>
  
  <p>How it looks in my browser:
  <a href="http://i.stack.imgur.com/YUCAf.png" rel="nofollow">http://i.stack.imgur.com/YUCAf.png</a>
  It in Dutch so you probably wont understand it. The bigger part is the LastName field (value) and the smaller letters are the First Name (label).</p>