Skip Navigation

[Resolved] Multiple Submit Buttons On A Single Cred Form

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use different submit buttons in a Form to allow Users to change the post status manually. One button for "Pending Review", one button for "Publish", etc.

Solution: You can create 4 Forms, one for each post status. Remove the other input fields except the main CRED form shortcodes and the submit button shortcode. If the Form's only purpose is to modify the status of the post, then this could work.

This support ticket is created 6 years, 3 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1096370

Tell us what you are trying to do?

I would like to add multiple buttons to a single cred form with each putting the post into a different status ie. one for draft status, pending review, and one for published. The purpose is because I would like to allow it to be editable in the draft status and then make it non-editable with pending review and or published. Is there a workaround to implement this?

Is there any documentation that you are following?

Looked through the cred form docs and some internet searches. Most information says one form one button.

Is there a similar example that we can see?

What is the link to your site?

The site is on a local enviroment.

#1096398

Hi, yes generally one Form contains one Submit button. But there's no reason you can't create 4 Forms, one for each post status. Remove the other input fields except the main CRED form shortcodes and the submit button shortcode. If the Form's only purpose is to modify the status of the post, then this could work.

On the other hand if the Form should allow Users to modify other parts of the post, then this approach won't be practical. Instead, you can use one Form with a generic radio field or a generic select field that contains 4 options - one for each post status. Then you can use the cred_save_data hook to modify the post status based on the selection in that field. Here's another ticket you can use as a reference: https://toolset.com/forums/topic/manage-native-wordpress-post-status-in-cred-form/

If you need more technical assistance with that I'm glad to help.