Skip Navigation

[Resolved] Single CRED form – multiple submit buttons/actions

This support ticket is created 6 years, 11 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by John Johansen 6 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#602494

Tell us what you are trying to do?
For a given CPT entry, I want to perform various actions by selecting one of several buttons on a form. Some of the actions may update the entry, other actions may only use the custom fields from the entry but not update them.

Is the single-form approach viable? That is, I'm not sure how the PHP code inside a filter that will recognize which submit button was pressed.
Or, should I create multiple forms (each with a single submit button) and integrate them into a layout for the CPT entry?

Is there any documentation that you are following?
CRED
Is there a similar example that we can see?
No
What is the link to your site?
N/A

#602569

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - could you please share screenshot how you would like to organize your form?

Are you talking here multiple edit button on listing page with each entry?

#602649

I don't have a working form yet, so no screenshot at this time.

I simply want to know if it's 1) practical to use multiple submit buttons on a single form, and 2) if it's a good practice to do so, or 3) whether I should consider creating a single layout that contains multiple forms that each have only a single submit button.

#602920

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1) practical to use multiple submit buttons on a single form,and 2) if it's a good practice to do so, or 3) whether I should consider creating a single layout that contains multiple forms that each have only a single submit button.
==> Well - its not suggested to use single submit button for multiple forms as with CRED each form rendered with fields its own CRED form ID and it may break things and will not work as expected.

#602928

Just to clarify, I never suggested using a single submit button for multiple forms. That's not what I want to do.

I wanted to know whether it was a good idea to use multiple submit buttons on a single form (so that each one could trigger a separate set of actions), or whether I should consider integrating multiple forms (each with its own submit button) into a single Layout .

#602955

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

whether I should consider integrating multiple forms (each with its own submit button) into a single Layout .
==> Yes - this is the suggested way to follow, each form with its own submit button and yes, you can use multiple forms with single layout.

#604052

I have successfully tested using multiple forms within a single Layout.