1

I am designing a HTML form where i have to take date in "DD/MM/YY" or "DD/MM/YYYY" format and i have to achieve this task using only HTML date control. I have done extensive research and haven't found any way to do it. Can someone help me.

Anidh Singh
  • 302
  • 2
  • 7
  • 19

2 Answers2

1

Refer this link: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date Or you can use jquery date picker also for this.datepicker is very easy to use.

0

<form method="POST" action="">
<input type="text" pattern="(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d" required />
<button>ok</button>
</form>

Use regular expression like patterns.Refer HTML5 pattern, Docs, http://html5pattern.com/Dates