Show date automatically when creating form

Asked

Viewed 109 times

1

I have this code:

 <p><h5><strong>Data de Atribuição</strong></h5> <input id="DataAtribuicao" type="text" name="DataAtribuicao" value='<?php echo date("d/m/Y"); ?>'>

But I wanted the same but where the type="date" and the date of the day automatically appears.

  • It is better to use pure javascript not all Html5 features run the same in different browsers when it works. How to format date in javascript?

  • You can put an example?

  • an example https://jqueryui.com/datepicker/

1 answer

0


Your input this with the value misspelled.

Try this in your. php file and test in your serve local:

<input type="date" value="<?php echo date("Y-m-d");?>">
  • It works.... Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.