-5

is there a way to use an input type text for dates ? What I mean is just to limit the the input text at

YYYY-MM-DD

  • 2
    Possible duplicate of [How to validate HTML5 date format](https://stackoverflow.com/questions/35151965/how-to-validate-html5-date-format) – Cold_Class Mar 07 '18 at 15:17
  • If it is OK to open a calendar or you're happy using dd-mm-yyyy format instead of yyyy-mm-dd as date you could use this in the html: – J_P Mar 07 '18 at 15:28

1 Answers1

0

Need to set type of field.

<input type="date"> is what you need.

For more about types, https://www.w3schools.com/html/html_form_input_types.asp

Naveed Ramzan
  • 3,565
  • 3
  • 25
  • 30