Here is my input tag:
<input type="text" name="EndDate" value="<?php echo $StartDate; ?>">
I am using PHP as well so I have made a function to do this task:
function validateDate($date, $format = 'Y-m-d H:i:s'){
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date)
}
function was copied from this answer or php.net
My question is how do I incorporate the function into the input tag? Or if there is an easier way please let me know! Thanks!