Hi Andy
I'm struggling to see how this could work in the way you have divided the form by hiding sections.
My advice to split the CRED forms works differently.
Let's say you have a form you want to split into 3 sections.
First you make a CRED post form to publish the post that contains just the fields of the first section, with a button that says "Next".
This "Next" button is actually a normal submit button, and when the form is submitted a post is created.
Any validation (e.g. required fields) for this first step is performed with the form submission.
The form settings should redirect to display the published post after submission.
But... instead of the post itself being displayed you display a CRED edit form to edit this new post, and this edit form contains the fields required for section 2 of your form. It has a next button which will update the existing post with the new fields. It will again redirect to display the updated post, and we will employ the same technique to show a third CRED form, which is an edit form that only contains the fields required for the final section.
The trick here is that you need a little custom PHP using the CRED API to add a URL parameter that will trigger displaying the CRED edit forms instead of the actual post after the redirects.
CRED edit forms must live inside a Content Template to provide the right context, so in this case you will create two edit forms and so you will need to add these to two Content Templates: make a note of the IDs of the Content Templates.
Then you can use code like this to chain together the sections of your form:
/**
* Redirect to edit post published by CRED form
*/
add_filter('cred_success_redirect', 'tssupp_edit_published_post', 10, 3);
function tssupp_edit_published_post($url, $post_id, $form_data) {
$suffix = "";
// step 1
if ( 123 == $form_data['id'] ) { // ID of initial CRED publish form
$suffix = '?content-template-id=456'; // ID of CT with first edit form
}
// step 2
if ( 321 == $form_data['id'] ) { // ID of first CRED edit form
$suffix = '?content-template-id=654'; // ID of CT with second edit form
}
return $url.$suffix;
}
Note that you will have to edit the IDs of the CRED forms and the Content Templates holding the CRED edit forms.
Does that make sense? Let me know if you have any problems implementing it.