I have a customer registration page with a field for date of birth. I can choose a date and save it in the database. But when I go back to that client's signup screen this field ( type="date"
) is not displaying the value saved in the database. Can anyone help me understand what's wrong with my code?
<? $dtnascimento = '';
if($rst[0]['datanascimento'] != '') {
$dtnascimento = $rst[0]['datanascimento'];
$dtnascimento = date_format(date_create($dtnascimento),"d/m/Y");
} ?>
<label>Data de Nascimento</label>
<input type="date" id="datansc" name="datansc" value="<? echo $dtnascimento ;?>"/>