validation for date fields?

More
6 years 1 week ago #73074 by chrisgraf
I have a standard "date" field (without time) and it seems to expect the date to be in the format YYYY-MM-DD. If a date is entered with the keyboard and it is not the mentioned format the date is replaced with today when the form is saved but there is no validation, warning or error. How can this be captured and thrown back to the user?

Is it possible to change the expected format? Or is it possible to show the expected format as a default text?

thanks for your time!

Please Log in or Create an account to join the conversation.

More
6 years 1 week ago #73086 by ggppdk
Replied by ggppdk on topic validation for date fields?
Hello

the change is done via calendar JS when you click submit and not when the data are validated on server

Yes we could add adding configuration for customizing this
because the Joomla calendar supports defining custom formats

but

we first for proper UX,
we should add a placeholder to the input field to indicate or display the placeholder as a tip text to the side

YYYY-MM-DD

which will be a language string so that it is translatable


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
6 years 1 week ago #73087 by chrisgraf
thanks for your answer. A placeholder text with the correct format sounds a good first step.

But some kind of validation is also required to prevent accidentally submitting wrong data. Currently you can enter anything (even garbage text) and it will get replaced by today's date. The default behavior should be to verify against the required format and prevent any submission with a wrong date format.

Do you consider implementing something like that? Do you have any other solution other then preventing text input as a whole?

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.701 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline