how to change date picker to a required field?
I have tried this but does not work
<div class="input-field col s6">
<label name="buildDate" class="">Build Date</label>
<input id="buildDate" type="text" class="datepicker picker__input" required>
</div>
From the datepicker documentation
By default, typing into the input is disabled by giving it a readOnly attribute. Doing so ensures that virtual keyboards don鈥檛 pop open on touch devices. It is also a confirmation that values passed to the server will be of a consistent format.
Because each input is readOnly by default, HTML5 attributes, such as required and pattern, do not get enforced.
You can manually check for the values instead
checkout the example https://jsfiddle.net/9e33kq0q/1/
@anantoghosh - Thanks for the manual check example. Do you know of a way to show the "data-error" defined in the label when it's invalid?
Add some css
https://jsfiddle.net/anantoghosh/cgzLmx0t/1/
Thanks @anantoghosh !
Most helpful comment
Add some css
https://jsfiddle.net/anantoghosh/cgzLmx0t/1/