Link Forms on WordPress

You could create a hierarchical custom post type and create a post for each form. Child forms are then set under a parent, their slug or a post meta field connected to the answers of their parent form.

When the form is submitted, you use the answer to select the best matching child and the you show that child form.


Another approach.

  1. Create a special endpoint, let’s say submit with the sub-type step.

On the main page, show the form. When the submission is a POST request, validate the submitted data and either show the same for again to correct user errors or …

  1. Create a new post for that company with wp_insert_post(). This function returns a post ID. Redirect the user to the next step (/submit/step/2) and show the next form. Add the post ID as hidden field, and set a cookie for the user, so you can track the progress.

  2. Again, when that form is processed lead to step 3 or a success message.

error code: 523