Make datalist required
<p>I would like the user not to be able to submit a form unless they have selected something from the dropdown <code>datalist</code> which appears as they type. If they just typed something random, I <strong>don't</strong> want the form to be submitted.</p>

<p>If this isn't possible, would a better option to be to check if the typed text appears in the datalist when the user submits?</p>

<pre><code>&lt;form method="post"&gt;
    &lt;input type="text" list="browsers"&gt;
    &lt;datalist id="browsers"&gt;
        &lt;option value="Internet Explorer"&gt;
        &lt;option value="Firefox"&gt;
        &lt;option value="Chrome"&gt;
        &lt;option value="Opera"&gt;
        &lt;option value="Safari"&gt;
    &lt;/datalist&gt;
    &lt;input type="submit" name="submit"&gt;
&lt;/form&gt;

&lt;?php 
if(isset($_POST['submit']
   // function to check if something from the datalist was clicked and NOT just typed
}else{
   echo'Select something from the datalist!';
}
</code></pre>

<p>While I can set the <code>datalist</code> as required, this can easily be by-passed.</p>