title: Date function in JS, comparing with a set date not working
body: <p>I have to pretty much validate and check if the user is underage in ASP. So anyone under the age of 01/07/1998 is underage. I have 3 dropdown lists to select date, month and year. Im using JS. I try using concat and split but they dont work. Can anyone help with this?</p>
  
  <pre><code>function ValidateDate() {
      var dDay = document.getElementById('DateList');
      var dMonth = document.getElementById('MonthList');
      var dYear = document.getElementById('YearList');
  
      var day = dDay.selectedIndex;
      var month = dMonth.selectedIndex;
      var year = dYear.selectedIndex;
  
      var firstValue = year + month  + day;
  
      var setyear = "1998";
      var setmonth = "06";
      var setdate = "01";
      var secondValue = setyear + setmonth + setdate;
  
      var firstDate = new Date();
      firstDate.setFullYear(firstValue[0], (firstValue[1] - 1), firstValue[2]);
  
      var secondDate = new Date();
      secondDate.setFullYear(secondValue[0], (secondValue[1] - 1), secondValue[2]);
  
      if (firstDate &gt; secondDate) {
          alert("Pass");
      }
      else {
          alert("Fail");
      }
  
  }
  
   &lt;asp:CustomValidator ID="CustomValidatorDate" runat="server" 
                          ErrorMessage=" You are underage" CssClass="error" Display="Dynamic" ClientValidationFunction="ValidateDate" &gt;&lt;/asp:CustomValidator&gt;
  </code></pre>