Joomla 5 Notice

We are pleased to announce that as of October 14, 2025, all of our Joomla extensions are compatible with Joomla 6.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5 and 6!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

Problems with date field default value and validation

More
2 years 6 months ago - 2 years 6 months ago #9215 by Administrator AV
Hi Nick,
I changed the subject, because I think, this is not a Edit View problem in the first place.
I hope this is okay with you.

Sadly I cannot reproduce your problem

I set up a test form with a date field.

In the field configuation on the tab "Basic Options" set up the following options.

Minimum date validation: A fix date
Minimum date: 04/01/2021

Maximum date validation: A fix date
Maximum date: 04/30/2021

Fill Field With: Fix date/Day date
Checkbox "Current date": checked

I display the form in Frontend, using a menu item of type Visforms Form.

When I open the form, the date field is prepopulated with the current date (04/24/2023)
When I just hit the "Submit" button, the Javascript validation kicks in and an error message is displayed (Please selec a date lower or equal to 04/30/2021)
The form cannot be submitted, until I select a date between the minimum and the maximum date, as they are set up in the field configuration.

If I circumvent the Javascript validation, so that I can submit the invalid date, then the php validation kicks in.
In this case, the form is redisplayed.
A php error message ist displayed.
The data are not stored in the database.

So with the correct field configuration, the problem you describe does not result.
I was wondering whether, maybe you just did not set up the field correctly?
Maybe you forgot to check the "Current date" option?

If you cannot find a problem in the field configuration, then I could take a look into the problem.
The question is, can you provide us with an Akeeba backup of the site, then?
We use the following platform for this purpose:
wetransfer.com

I actually would not use a default value for the field, but make it requiered instead.
But setting it up with a default value outside the range of a min/max validation should work and does work in my test.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 5:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 4.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 5:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 4.
Bitte immer nur 1 Frage pro Thema stellen :-).
Last edit: 2 years 6 months ago by Administrator AV.

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum