Skip Navigation

[Resolved] Toolset forms

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 4 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1600987

Tell us what you are trying to do?
I want to create a multi-step form to capture users request for medical supplies that will enable users to capture name, type, and quantity then users add delivery address in the next step
Is there any documentation that you are following?
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-creating-content/
Is there a similar example that we can see?
hidden link
What is the link to your site?

#1602077

Hello,

I assume we are talking about this case:
- One post type "request for medical supplies"
- lots of custom fields in above post types: name, type, and quantity then users add delivery address

You are going to setup multi-step forms, each form controls only few of above fields.

If it is, you can try these:
1) Create a post form for creating "request for medical supplies" post(for example, form name is "Step 1", form ID is 123), display only few fields.
option "After visitors submit this form" choose: Display the post.

2) Create a post form for editing "request for medical supplies" post(for example, form name is "Step 2", form ID is 456), display other custom fields.

3) Create a content template "step-2-ct", display above editing post form, (for example, the content template ID is 789)

4) Create a page, and display above post form

after users fill and submit the form "Step 1", you can use filter hook "cred_success_redirect" to trigger a PHP function, redirect them to the content template "step-2-ct", for example, add below PHP codes into your theme file "functions.php":

add_filter('cred_success_redirect', function($url, $post_id, $form_data)
{
    if ($form_data['id']==123){
    	$url = add_query_arg( array(
            'content-template-id' => '789',
        ), $url);
    }
   
    return $url;
}, 10, 3);

Please replace 123 with "step 1" form's ID, replace 789 with content template "step-2-ct" ID

Then user will be able to use "step-2-ct" content template to edit the new created post.

More help:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect