Skip Navigation

[Resolved] post form submit buttons

This support ticket is created 5 years, 2 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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 5 years, 2 months ago.

Assisted by: Waqar.

Author
Posts
#1325757

I have to create a form that allows to register a custom post type.
I need to create two form submission buttons, one that records if the required fields are not filled and a one that only records if the required fields are filled in.

How can I achieve this ?

#1325991

Hi Olivier,

Thank you for contacting us and I'd be happy to assist.

When a Toolset Types field is set as required, in the field's setting ( req: https://toolset.com/documentation/user-guides/using-custom-fields/ ), that validation rule is automatically applied to it in the admin area ( post edit screen ) and also in the front-end Toolset Forms.

It is not possible to have two submit buttons in the same form or make the form ignore that required validation rule on-the-fly, but you can use a workaround that involves two separate forms.

First, you'll make sure that no fields are set as "required" from the field's own setting.

Then in your first form, you can include all those fields and it will be possible to submit the form without any validation.

In the second form, you'll also add all those fields, but for this form, you'll add validation rules to the fields that you'd like to be required, through either "cred_form_validate" hook ( ref: https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate ) or through conditional form groups ( ref: https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/ ).

This way, the second form's submission won't be possible, unless the specified fields have been filled.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1326005
capture3.jpg

I need to display a single form with two buttons as on the capture. Is it possible to do that with your method?

#1326897

Hi Olivier,

Thanks for writing back and for sharing the screenshot.

I'm afraid the two-button submit feature that is shown in your screenshot, is not supported by Toolset Forms, out-of-the-box and the workarounds that I've shared will also not work for this specific requirement.

This will require form customization, for which you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar