Formidable icon indicating copy to clipboard operation
Formidable copied to clipboard

Render of 'date' input is incorrect

Open chippyash opened this issue 6 years ago • 3 comments

The rendering of an <input type="date"/> is incorrect. You are over riding with three drop down selectors. This should be pulled out as browsers know how to render. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

The problem is with the current solution is that it if your markup specifies an id for the field (not uncommon if you are using <label for.../>) ,the id is repeated for the day, month and year selectors.

Also, year is restricted to max of current year.

You'd almost be better to rely on jquery date, but that brings in a dependency you may not want.

So, suggest you a/ enable an option that allows no library rendering of date field and b/ appends .day, .month and .year to the id if present to prevent html syntax failures and c/ allow specification of min and max dates.

chippyash avatar May 15 '18 17:05 chippyash

What do you mean by "no library rendering" ? Avoiding the three dropdowns ? I'm ok with the id change I don't understand how the min and max would be handled, maybe with relative dates like min="-1year" or max="now" ? (handled with strtotime ?)

Gregwar avatar May 15 '18 19:05 Gregwar

'no library rendering' - switch off the Formidable library rendering of the date field, leaving it simply as <input type="date"/> in the html rendering. id change: can be handled as separate issue/PR min and max handling: yes, that needs some discussion. Can be handled as a separate issue/PR

chippyash avatar May 16 '18 08:05 chippyash

Yes ok, disabling the library rendering might be the default, don't you think ? Not sure how much this is currently supported

Gregwar avatar May 16 '18 11:05 Gregwar