title: how to check date in range in Javascript
body: <p>In below Code i want to validate date between 02/08/2017 and 05/08/2017 and give us a alert which is Date is not in range</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          function validate()
          {
  
          today = new Date();
          fromdt= new Date("02/08/2017");
          todate=new Date("05/08/2017");
  
          if( document.myForm.entrydt.value == "" )
             {
               alert( "Please Select Entry Date!" );
               document.myForm.entrydt.focus() ;
               return false;
             }
             else if(!document.myForm.entrydt.value.match(letters3))
            {
            alert("Entry Date: Enter Only Date Format i.e DD/MM/YYYY");
            document.myForm.entrydt.focus() ;
                  return false;
              }
              else if (!document.myForm.entrydt.value.today &gt; startdt &amp;&amp; !document.myForm.entrydt.value.today &lt; todate)
              {
              alert("Entry Date: Enter Date in Proper Range");
            document.myForm.entrydt.focus() ;
                  return false;
              }
          return( true );
          }
          &lt;/script&gt;
  </code></pre>
  
  <p>==============================================================================</p>
  
  <pre><code>&lt;form method="post" action="&lt;?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?&gt;" class="form-inline" role="form" name="myForm" id="myForm" onsubmit="return(validate());"&gt;
          &lt;div id="" class="container" &gt;
                              &lt;div class="form-group"&gt;
                                  &lt;label for="entrydt"&gt;Entry Date&lt;/label&gt;=
                                  &lt;input class="form-control" style='font-weight:bold;text-transform:uppercase;' id="entrydt" type="text" name="entrydt" style='' placeholder="DD/MM/YYYY" value="" size="10"&gt;
                              &lt;/div&gt;
              &lt;/div&gt; 
          &lt;/form&gt;
  </code></pre>