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

前端 未结 16 1644
遇见更好的自我
遇见更好的自我 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:04

    You have used regular expression for this format : DD - MM- YYYY

    If you need this format DD/MM/YYYY use

    var pattern =/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/;
    

提交回复
热议问题