Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

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

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

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?

"Front end" editing of submitted form data

More
1 year 5 months ago - 1 year 5 months ago #9211 by NickPovey
From my experience VisForms is a fantastic and versatile form solution.

I am aware that in front end edit the form is effectively re-run and fields auto filled by an SQL statement may therefore get updated when not wanted to be.

Work arounds are available and these are documented in the "Auto Increment Field" thread.  vi-solutions.de/en/forum-index/19-joomla...auto-increment-field

I have recently become aware of a similar behaviour with a date field.

In my work flow I have a date field with a default value of today's date. This field is used to collect a person's date of birth. I have also set a maximum age and minimum age. So the person completing the form is forced to input a new date which has to be plausible.

When the date is viewed in the front end edit view the date shown is today's date, not the date of birth that had been submitted.

Interestingly the date in the front end edit form doesn't get saved if it is left as today's date and the original value is preserved - I guess because it fails to meet the max/min age. However it doesn't cause an error or give a warning and other changes are saved. If a date value within the max and min range is input during edit then that value does get saved.

If it were possible to have an option available for relevant fields to select "Use the stored value when opening the form in front end edit" that would be a very nice addition.

Nick
Last edit: 1 year 5 months ago by NickPovey.

More
1 year 5 months ago #9289 by Administrator AV
Replied by Administrator AV on topic Problems with date field default value and validation
Hi Nick,
I'm sorry, but somehow something went wrong with your Post.
I answered you post from 2 weeks agoo, straight away.
But I also changed the title and obviously I made some mistake when I changed the title, because your part of the post got lost.
And I think, you were never informed about my answer.
I'm so sorry for that.
I would really like to use the subject 'Problems with date field default value and validation'.

Here ist my original answer:
---
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 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum