I'm trying to have a form field with mm/yyyy as an input. Can you help me in suggesting a way to have this date format ?
Is there a way to display the form field as mm/yyyy in html form?
746 Views Asked by Akshaya Dupati At
5
There are 5 best solutions below
1
On
<label for="birthdayMonth">Enter Birthday month-year:</label> <input type="month" id="birthdayMonth" name="birthdayMonth">
Try this:
0
On
Try to use the below code in your form. It should allow you to enter the month first then the year after.
<label for="start">Date:</label>
<input type="month" id="start">
In your html code use the input element and give it the "month" type (YYYY-MM)
To get the date and year, you can use javascript