title: how do I alert user when they didn't select an option on a drop-down menu
body: <p>I made a drop-down menu for user to select,for the date, it looks like this</p>
  
  <p><a href="https://i.stack.imgur.com/sMG63.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sMG63.png" alt="enter image description here"></a></p>
  
  <p>How do I the alert user that they didn't select a date? The month, day and year are options in the <code>&lt;select&gt;</code> element</p>
  
  <pre><code>if(document.forms[0].checkindate.selectedIndex == 1) {
      window.alert("You must select a date.");
      return false;
  }
  </code></pre>
  
  <p>I did this, but it doesn't work.</p>