Hello,

I guess I'll get straight to the point.

Create a webform, add a date field, make it mandatory, and leave all defaults.

Select any date greater than 2 years to the current date. Example :

Today being 2012-08-22 : 2014-08-23 or greater

Submit the form. You will see :
The entered date must be 2014-08-22 or earlier.

I don't believe anyone using the form should receive an error since those dates are available to them. However, I have noticed that the date picker correctly reflects the upper and lower bounds.

After looking into this, I believe the only perfect solution is the one offered by html5 : input type date min max attributes.

As for the select boxes, I don't think much can be done -- other than fixed date boundary using full years. Maybe someone else has an opinion?

Best regards

Comments

nlambert’s picture

Maybe javascript could disable the select boxes and the input could be left to the date picker.

quicksketch’s picture

I don't think there's anything we can do to solve this problem while using a normal field element. Using an HTML5 date field won't solve the problem any time soon, since browser support is still minimal (not supported in IE or Firefox): http://www.w3schools.com/html5/html5_form_input_types.asp

You might look into this issue: #775526: Inline Date Picker?, which would hide the normal field and present *only* a date picker.

nlambert’s picture

Totally agree.

Thanks for the link to the inline date picker issue.

Would you therefore find useful a patch for the following?

( ) Popup calendar
(•) Popup calendar with disabled select boxes
( ) Inline calendar
( ) No calendar

Javascript could optionally grey out the select boxes and oblige the use the Popup calendar yet allow the user to see the selected date.

Superfluous?

quicksketch’s picture

I don't think disabling the select lists is particularly a good approach, seems like it would only cause confusion. Disabling elements will also prevent them from being submitted as part of the POST request, so you'd have to duplicate the select lists just to disable them. Overall not a very pretty solution and doesn't provide much value anyway. If you were going to just display the date, you would want to display it as text.

nlambert’s picture

Status: Active » Closed (works as designed)

Agreed.
All the best.

nlambert’s picture

Issue summary: View changes

added explanation to a phrase