title: Datalist option validation required
body: <p>Here is all the details</p>
  
  <pre><code>&lt;form action="order.php" method="post" name="myForm" onsubmit="return(validate());"&gt;
  &lt;input type="text" list="From" name="From" autocomplete="off" placeholder="From Place"&gt;
  &lt;datalist id="From"&gt;
     &lt;option value="Bankura Bus Stand"&gt;
     &lt;option value="Bankura Hospital"&gt;
     &lt;option value="Katjuridanga"&gt;
     &lt;option value="Lokepur"&gt;
  &lt;/datalist&gt;
    &lt;datalist id="To"&gt;
    &lt;option value="Bankura Bus Stand"&gt;
    &lt;option value="Bankura Hospital"&gt;
    &lt;option value="Katjuridanga"&gt;
    &lt;option value="Lokepur"&gt;
  &lt;/datalist&gt;
  </code></pre>
  
  <p>Javascript Validation</p>
  
  <pre><code>&lt;script&gt;
      function validate() {
         if (document.myForm.From.value == "") {
         alert("Please select From Place.!");
         return false;
         if (document.myForm.To.value == "") {
         alert("Please select From Place.!");
         return false;
  &lt;/script&gt;
  </code></pre>
  
  <p>Everything work fine, but i want only option value otherwise show alert error: when click on submit button</p>
  
  <pre><code>&lt;input type="submit" value="Book Now"&gt;
  </code></pre>
  
  <p>I want it by same script procedure... Thanks in advance</p>