+ 2
javascript
Help me, i started doing javascript recently and im trying out stuff. For the date of birth text field,a valid date must be entered in valid dd/mm/yyyy format. Applicants must be at between 15 and 80 years old at the time they fill in the form.
2 Respostas
+ 2
I think that can help you:
1) to check format:
/([0-3][0-9]\/[0-1][1-9]\/[1-2][0-9]{3})/
2) current date:
new Date();
getDate();
getMonth();
getFullYear();
3) you check if current year minus year from user is bigger than 15 when is equal you check month when this is also equal you check day the same with 80 but you check or is less
+ 1
Welcome! We're happy to hear that you are trying out stuff. Would you mind posting one of your tries to the Code Playground (curly braces if you're on the app, green circle with plus sign to add project, select Web for project type) and providing the project link to this thread so we can take a peek under the hood?