Date field input mask

Hey - is it possible to limit the date picker to just MM/YYYY ?


Hi Stuart. That is not currently possible with the datepicker. Could you use two dropdown fields, one with months, the other with years? Or, offer a text field with the masked input option, and this input mask:


That would not prevent 25/3456 but it would show the visitor the desired format. If necessary, you could combine that with the gform_field_validation filter to return a validation error if the month is not a valid month, and the year is not within your desired range:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.