Hey @pikamander2 your thread is kind of old – but this is for everyone who is still looking for an answer.
Contact Form 7 changed its validation and added a data-name attribute as well as a schema validation.
The first point is kind of solvable by changing the JS of this plugin.
In scripts.js after line 39 add following:
$formControlWrap.attr("data-name", newName);
And use a minifier tool like https://www.toptal.com/developers/javascript-minifier to minify the js file and replace the scripts.min.js
This will solve the issue”The field is required.” – but one issue remains – the validation on the fly. Like on change of any field the validation won’t trigger because of the new contact form 7 changes to check against the schema calling a feedback endpoint.
But yeah the form is now usable – and the validation works for the submission.
Refernce:
https://github.com/takayukister/contact-form-7/blob/aead86c2b67985fc4d77d833ad1caa78afa4dbf7/includes/js/src/validate.js#L86
Let me try to break it down once more for everything to understand it.
This plugin does rename the names of the fields for example “first_name” will get a new name “first_name__1”. (Reason is pretty clear: It clones the fields, so it needs new incrementing names).
@sfdeveloper I’m slowly getting back to this plugin and I’ve applied your solution to the upcoming version. Do you happen to work with the plugin often? I’d like someone else to give it a try before I publish it: https://github.com/felipeelia/cf7-repeatable-fields/archive/refs/heads/trunk.zip
This version does not fix all the problems but it at least paves the way to do that. It also bumps some minimum requirements. Thanks in advance!
Hey @felipeelia – Thanks for reviving the plugin.
The update appears to have mostly resolved the required field issues, although there does still appear to be one issue with required checkbox fields where submitting a form with no checkboxes filled out will throw a “One or more fields have an error.” error but doesn’t indicate which field has the problem. I was able to reproduce it on both our existing site and a fresh installation.
[checkbox* mycheckbox "thing1" "thing2"]
Thanks, @pikamander2! Any chance you can file a new bug report on the GitHub repo? I’ll try to keep everything there from now on.
I’ve moved the new problem to GitHub: https://github.com/felipeelia/cf7-repeatable-fields/issues/61
As there is no other actionable item in this thread, I’m marking it as resolved.