Required Field inside Repeater Area with Multiply - always fails validation

rikford 14 Feb, 2018
Hi,
​
I've just updated Chronoforms from v6.0.6 to 6.0.16, which has fixed problems with email formatting and the repeater area - good - but created a problem in that when a field in a Repeater Area is marked as Required, when submitting the form, the field fails validation whether it is empty or not. Similar fields outside the Repeater Area work fine.
I have added the {var:repeat_name.key} to the field name and id as previously mentioned in this forum. What am i missing? simple example of setup that fails validation whether First Name(s) is populated or not, is below. Validation tab just has Required selected.
Required Field inside Repeater Area with Multiply - always fails validation image 1
Max_admin 14 Feb, 2018
Hi rikford,
​
Please test the form using the "Preview" button in the form edit page, does the form work as expected ?
​
I have just tested this with a single field form and it works fine.
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rikford 14 Feb, 2018
No, it doesn't - same issue
I've just done a test custom Javascript validation below, as mentioned elsewhere in the forum, and that does work. I guess I can tweak that to get the required result? But would be much easier if i can get it working without that. and I wouldn't get the red * for required field.
​
jQuery.fn.form.settings.rules.customfn = function(value, param) {
var x = 12;
if (Number(value) < Number(x)) {
return false;
}else{
return true;
}
};
Max_admin 14 Feb, 2018
Can you post a link to the form here so I can check it ? you can have it inside a private box (the lock icon)
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rikford 14 Feb, 2018
Sadly, this is on a development site at the minute, not available from outside. I can set it up on another live site, I'll get back to you when I have...
​
Thanks
​
Rik.
rikford 14 Feb, 2018
Hi Max,
​
You can see the problem on this form:-
​

This is private content


​
Thanks,

Rik.
rikford 15 Feb, 2018
Hi Max, Any more thoughts?
Max_admin 16 Feb, 2018
Hi rikford,
​
The validation works fine, before clicking "add" or after, all required fields are marked as required and the error is shown below, I tested this on Google Chrome browser, which browser do you use ?
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rikford 16 Feb, 2018
Hi Max,
​
I use Firefox primarily, also IE, Safari. Installed Chrome too, that also fails for me. from the Test form I indicated to you on Wednesday:-
​
Required Field inside Repeater Area with Multiply - always fails validation image 2
Max_admin 16 Feb, 2018
Hi rikford,
​
Ok, please press F12 on your keyboard to open the browser console, do you have any errors there ?
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rikford 17 Feb, 2018
Hi Max,
​
No error shown on F12.
​
Are you saying that when you access the test form site advised on Wednesday that, for you, validation works correctly? even though when i access the same form from four different browsers on three different devices, i still get the error?
​
Thanks,

Rik.
Joao Serina 20 Feb, 2018
Hi Max,
​
I am having the same problem as rikford with my repeater areas. If the validation is turned on, the fields are filled properly and I submit the form I get the error saying the fields are empty.
​
I have tried loading the fields with validation turned off and then use the "multiply" button to turn it on (through the field events tab) but it does not work.
​
I also have no errors on the console.
​
(This happens both with Chrome and Firefox).
​
Thank you very much for your time.
​
Best regards,
Joao Serina
Max_admin 20 Feb, 2018
Hi Joao,
​
You are speaking about the server validation which appears AFTER the form is sent, if this is correct then you are having the expected behavior, its not working with the repeater and you will need to configure the "Validate fields" action to skip the fields inside the repeater.
​
I will try to add this feature to a future update.
​
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Joao Serina 20 Feb, 2018
AH! I see. That's it πŸ˜€ So if I want server side validation I'll have to create my own custom PHP correct?
​
Thanks a lot!
​

Best regards,
Joao Serina
rikford 20 Feb, 2018
Hi Max,
​
Is that also the answer for my scenario? My incorrect validation errors only appear after pressing the Send button, when validation occurs prior to the email being sent.
​
Thanks,

Rik.
Joao Serina 20 Feb, 2018
I just have one question, in the "Fields list" should I used the fields names, ids or classes?
​
The name of the one of my fields is "Sample-{var:area_repeater24.key}-Information[Identification]" but when I add it to the "Field list" I still get an error that the field is empty.
​
I have also tryed using "Sample-#area_repeater24.count-Information[Identification]" but it didn't work either.
​
I have looked in the manual but couldn't find the information.
​


Best regards,
Joao Serina
rikford 20 Feb, 2018
Hi Max,
​
Your answer to Joao also fixed my problem.
​
In my example form, adding first_names{var:area_repeater3.key} as an exclusion to the Fields List of Validate Fields makes my form work as expected, no custom code required. Also had to set Fields list selection to All fields with validation rules but excluding those listed below.
​
Thanks.
​
Rik.
Joao Serina 21 Feb, 2018
Answer
1 Likes
Just figured it out! 🀣 IF you want to store all the information from each repeated area into an array like I am doing, you will need to used the "validate data" Tool instead of "Validate fields".
​
When storing the info of repeated elements into a single array you name the fields as: Repeated_area_array[field_property] and for some reason, "Validate fields" doesn't work with that name structure.
​
All you need to do is to place the field name (ex: Repeated_area_array[field_property]) followed by the validation rules as shown in the manual page 15.
​
Example for a required field:
Repeated_area_array[field_property]/required:This field is required.
Thank you Max and rikford for your time! πŸ˜‰
​
Best regards,
Joao Serina
Elita- 12 Mar, 2018
Hi to all, sorry for intrusion and perhaps too late, bet I had the same problem with Repeater field validation that resolved this way - instead of using built-in validation Toggle Required I put required:Required in the Validation rules field. At least this works for me.
This topic is locked and no more replies can be posted.