Nice to see you have added the Form Repeater to the latest release. It came at a great time as I needed exactly that for the project I’m working on.
The problem I have though is how to implement validation of the “repeated” form fields. jQuery validator doesn’t like me setting rules like “group-c[product_id]”.
Can you point me in the right direction?
Thanks for the awesome work you have done on the admin theme templates and all the features they have!
Ignore the above, I’ve sorted it.
The solution is to loop through the cloned form elements and dynamically add rules for each of the required fields (https://jqueryvalidation.org/rules/#.22add.22rules). This is done in the “form-repeater.js” when the block/elements are cloned.
I only needed to set a couple of my cloned fields to “required” so had to iterate over the fields to find the correct ones to set the additional rules.
Could be worth you guys doing a demo/example on the Form Repeater page 🙂
Great! Thanks for sharing this idea. We will add some advance usage of the form repeater plugin including form validation examples in a future updates. Stay tuned! 🙂
Will keep a look out. Will be interesting to see how you guys implement the solution 🙂
Sure. We will attend to this as soon as possible 🙂
I’d like to add my appreciation for all your hard work on the theme. I’m also having an issue with validation here and it’s taking so very long to figure out.
Any chance of a snippet to show your supporters how to achieve validation on controls inside the form repeater?
You must be logged in to reply to this topic.