Hi, I am close to finishing a feature for a client where fields of my form are randomly ordered and then separated into pages. With the help of Gravity Forms support, I now randomly sort the fields and save that order in a hidden field. This way I can rebuild the same order when using the “Save & Continue” functionality - we want a user to see the same order they had when accessing the form the first time.
In my (client’s) case, the randomly ordered fields are quite a lot (50+ - it’s part of a survey) and these need to be broken up into pages of 10 fields each. I was not able to add “page” fields to the form after the fact, so my approach is the following:
- Add all the necessary “page” fields to the form.
- Before ordering these fields, remove the “page” fields and save them in an array.
- After ordering the fields, add the “page” fields every 10 fields.
I have the above working but unfortunately the validation now isn’t playing ball. Because all my (randomly) ordered fields are mandatory, the validation fails when clicking on “Next”. I am assuming that this is because the fields of the first page are not all checked.
So we get to my question: How can I “reset” or “reapply” the validation after re-ordering fields and adding new pages?