function isValidDate(sText) {
        var reDate = /(?:0[1-9]|[12][0-9]|3[01])\/(?:0[1-9]|1[0-2])\/(?:19|20\d{2})/;
        return reDate.test(sText);
}
    function validate() {
        var oInput1 = document.getElementById("txt1");
        if (isValidDate(oInput1.value)) {
            alert("Valid");
        } else {
            alert("Invalid!");
        }
 
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-12-27
  • 2021-12-27
  • 2021-12-27
猜你喜欢
  • 2021-12-11
  • 2021-12-27
  • 2021-12-27
  • 2021-12-27
  • 2021-11-19
  • 2022-02-01
相关资源
相似解决方案