Date format in HTML form should be "mm/yy"
P粉990008428
P粉990008428 2023-09-01 11:00:27
0
1
600
<p>I want to create an HTML page containing a form, where one cell should be a date in the format 'mm/yy', with the minimum value being the current month (similar to a credit card expiration date). </p> <p>What should I do? I didn't find an option to use a date/month type, is there a better option than using text that matches a regex? </p> <pre class="brush:php;toolbar:false;"><input type="text" pattern="\d{2}/\d{2}" required></pre> </p>
P粉990008428
P粉990008428

reply all(1)
P粉521748211

I recommend using the "date" type. It has a lot of features built into it. You can also set minimum and maximum values. You can find more information here: https://developer.mozilla.org/ru/docs/Web/HTML/Element/Input/date

Example:

<input type="date"
   value="2018-07-22"
   min="2018-01-01" max="2018-12-31">
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template