With a form element of type date_select, a user is allowed to select invalid dates, such as April 31, or February 30. Upon submission, these dates are ignored, however, to improve UX, it would be better to have some JavaScript that manipulates the number of days shown in the day element on the fly, removing days that cannot exist based on the values in the year and month elements.

I'm submitting a patch that contains this JS, and automatically adds it to date_select elements.

I will attach it to the first comment, so that I can get the issue number to include in the patch name.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jaypan created an issue. See original summary.

Jaypan’s picture

DamienMcKenna’s picture

Status: Active » Needs review

Thanks for the patch, we'll try to review it soon.

BTW when you upload a patch it helps to set the status to "needs review", that triggers the testbots and lets others know that there's something review.

Jaypan’s picture

I don't even remember starting this thread. It must have been for a project I'm not on anymore.