I am having issues trying to figure out how, to create an html input box for the date:
like this:
YYYY-MM-DD
I was wondering if there is a better method of doing this than me manually creating something like this, and then using the - separators to separate the YYYY-MM-DD.
I will be using regex to do some validation after the user has entered the date of birth to make sure that it is greater than 21.
<label for="dob">Age (YYYY-MM-DD)</label>
<input id="dateofbirth" type="text" name="age" maxlength="10"/><span>*</span><br />
Here is my regex for the date that will be inside function checkdate on the php side:
return preg_match('/(\d{4})-(\d{2})-(\d{2}, $date);
Set date such that it will only take input from users over 21.
Currently this does not.
$date = '1974-12-03';