Link to home
Start Free TrialLog in
Avatar of Akhil Vinay Mandava
Akhil Vinay MandavaFlag for India

asked on

Query in DD/MM/YYYY

I need to palace DOB in text format only so i wrote the code like this but i need some validation like DD should be upto 31 days only,MM should be upto 12 months and similarlu YYYY also
  DOB<input  pattern="^([0-9]{02}/[0-9]{02}/[0-9]{4})" type="text" placeholder="DD/MM/YYYY"></td>

Open in new window

Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try
^(0[1-9]|[12][0-9]|3[01])[\/\-](0[1-9]|1[012])[\/\-](19\d\d|20(0?\d|1[0-7]))$

Open in new window

REgards
Avatar of Akhil Vinay Mandava

ASKER

Can u send the code without year validation ?
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks bro.
Solution according to author's comment