title: Validation of Html 5 Datepicker
body: <p>I am using Html5 date picker in my project of room reservation system please anybody help me to validate this date picker. Validation must include disabling dates earlier than today's date disabling dates which have been selected earlier for rooms.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;html&gt;
  &lt;body&gt;
  &lt;form name="f2" action="payment.jsp" method="get" &gt;
              &lt;label&gt; Date:&lt;/label&gt;&lt;br&gt;
              From:&lt;input type="date" name="from" id="myDate" value="demo"&gt;
              Till:&lt;input type="date" name="till" id="myDate1" value="demo1"&gt;&lt;br&gt;
    
   &lt;input type="submit" onclick="myFunction()"&gt;
   &lt;script&gt;
      function myFunction() {
      var x = document.getElementById("myDate").value;
      document.getElementById("demo").innerHTML = x;
       var y = document.getElementById("myDate1").value;
      document.getElementById("demo1").innerHTML = y;
  }      
  &lt;/script&gt;
    &lt;/body&gt;
    &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>