-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some useful extra validation added e.g validate-date #8208
Conversation
Can you minify the |
@zero-24 I have made changes in validate.js too. |
I have tested this item 🔴 unsuccessfully on e7f4cf8
Observe: The date is automatically transformed to a current date This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8208. |
@datredweb Thank you for testing. Have you added the class "validate-date" or "validate-datetime" to that date input field? It won't work without adding the validate class. |
I can see what you are doing here but as it is it is not ready for inclusion in the core. If you can look at how to implement validation on the date fields in the core joomla fields we can always re-open it when it is ready for testing again. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8208. |
I think it should be kept open. Maybe tested via a different test case. Since this is more like a library fix which allows for new validations .. Now that it's available it can be used in various parts of the Joomla core ? This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8208. |
Provide the method for testing then |
OK.. Will ask one of the team to Submit another PR to implement this in one of the Standard Joomla forms so that the test case can be provided. And provide that link here as well. |
Now you can validate your date and numeric fields.
For e.g
If you have a date field in your Joomla's form and the user enters a wrong date then you will get a fatal error on the page. So its better to validate the date field before saving.
Field 1- YYYY/MM/DD can be validate using class "validate-date"
Field 2- YYYY/MM/DD H:I:S can be validate using class "validate-datetime"
These changes have been added to "validate-uncompressed.js". To test this you will need to minify this file and replace the content of "validate.js" with this.
Let me know if any other information is needed.