Javascript Date Validation ( DD/MM/YYYY) & Age Checking

前端 未结 16 1649
遇见更好的自我
遇见更好的自我 2020-12-01 11:09

I\'ve started to work on Javascript recently. What I am testing is checking the DoB in valid format. Next step will be checking the age.

What my HTML code includes

16条回答
  •  情书的邮戳
    2020-12-01 12:14

    var date=/^[0-9]{1,2}\-[0-9]{1,2}\-[0-9]{1,4}$/;
    
    if(!date.test(form.date.value))
    
    alert("Enter correct date");
    
    else
    alert(" working");
    

提交回复
热议问题