Forums

Required field blocks submitting

bart99.hermans266 03 Feb, 2025

Hi Max,

I'm having a number of fields of which some are required and others are not. You can see in the first screenshot that all of them are filled out correctly, the one that is left blank is not required. There are no other checks apart from "required".

However, when I submit the form, it gives the "required" error for all the fields on the page.

Some more context:

* The purpose of the form is that a user can subscribe for an event.

* The field id's and names are created dynamically. I have a database table where the fields are defined, as they are specific for every event. 

* Upon submitting, the data that is entered in the form is written to the database.

* If I make none of the fields required (in the database), the form works fine.

I have been looking for errors in my configuration for the whole day, but cannot find anything and I suspect it might be a bug.

Could you please assist me?

Best regards,

Bart

1- Field ids and values are defined in the database.jpg
2- Read data from database.jpg
3- Loop through data fields.jpg
4- Text field settings.jpg
5- Form is shown correctly.jpg
6- Every field gives an error.jpg
Max_admin 03 Feb, 2025
Answer
1 Likes

the problem is that dynamic fields names (names with shortcodes) are not supported by the "Validation" code, that's why you get an error

I have fixed this issue and the next update should make it run without an error

is this urgent ? do you need a quick code fix ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
bart99.hermans266 03 Feb, 2025

Oh, good to know, thank you Max. It is not that urgent, it is not that much of an issue if the fields are not required, so I can wait for the next release.

Related question: if one of those dynamic fields is a file upload, could it be the reason why the file doesn't get uploaded? I have a test form where it works perfectly, but in this form the file upload field doesn't work, even if none of the fields are set as required it still doesn't upload.

In the debug information the field doesn't even show up under Data, Vars or Information, while it does in my test form.

Max_admin 04 Feb, 2025

yes, I think it's the same issue

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
bart99.hermans266 15 Feb, 2025

Hi Max,

I tested this in V8.0.39, but it is still not working.

The fields themselves are not red anymore, but I still cannot submit.

Do you need anything from me for further troubleshooting?

Best regards,

Bart

Max_admin 15 Feb, 2025

Hi Bart

You re correct, it's still not working if there is a Loop variable in the field name, other shortcodes should be fine, but loop vars no!

So I have fixed this here and it will be available in v8.0.40

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.