title: validate not working in the html
body: <p>this is a very basic web page. the validate part is not working in the code. On clicking submit, it is just checking for the inline validations and then directly going to the destination page.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function validate()
  {
      var tickt = document.form1.tickets.value;
      var child = document.form1.childrens.value;
      var date =  document.form1.showdate.value;
      var sysdate = new Date();
      var amount = (tickt - child) * 200 + child * 100;
  
      if (tickt &lt; child){alert("No of tickets should be greater than the no of children"); return false;}
  
      else if (date &lt; sysdate){alert("Show date and time should be either current date or future date"); return false;}
  
      else{alert("Your approximate ticket amount is "+amount" INR"); return true;}
  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;center&gt;&lt;h1&gt;&lt;b&gt;Movie Ticket Booking&lt;/b&gt;&lt;/h1&gt;&lt;/center&gt;
  &lt;form action="thankyou.html" name="form1" onSubmit= "return (validate());"&gt;
    &lt;table align="center"&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;Show date and time&lt;/td&gt;
          &lt;td&gt;&lt;input name="showdate" type="datetime-local" required id="showdate"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;No of tickets&lt;/td&gt;
          &lt;td&gt;&lt;input name="tickets" type="number" required id="tickets" max="10" min="1"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;No of childrens&lt;/td&gt;
          &lt;td&gt;&lt;input name="childrens" type="number" required id="childrens" max="5" min="1"&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;input name="Book" type="submit" id="Book"  value="Book" &gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>