Skip Navigation

[Resolved] Draft saving can do required field empty

This support ticket is created 3 years 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 3 voices.

Last updated by Waqar 3 years ago.

Assisted by: Waqar.

Author
Posts
#2273585

Tell us what you are trying to do?
I made draft and publish save button. but draft saving can't do required field empty

1. Can draft without filling in required fields
2. Public saves must fill in all required fields

Is there any documentation that you are following?
https://toolset.com/forums/topic/allowing-save-as-draft/ < it help me to made button
https://toolset.com/forums/topic/ignore-required-fields-when-saving-as-draft/ < this is not I want

What is the link to your site?
hidden link
this is for login user

#2274055

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I'm not quite sure I understand exactly what you want to happen.

If you add a required field to a post then

1. you can save a draft version of the post without completing the required field. This is intended.

2. you cannot publish the post without completing the required field. This is expected.

This is in the back end editor, not front-end forms.

Which are you talking about? Editing posts in the back end, or with front-end forms?

#2274541

I talking about editing post in front-end post forms.
It didn't work (1)

#2275001

Hi,

Thanks for writing back.

When using the front-end post forms, you'll have to fill in all the required fields to submit the form, even if you're saving the posts in the "Draft" status.

The workaround that you can use in this case is to remove the required status from those fields and you'll be able to submit the form, without filling in all the fields.

For any other form, where you do need those fields to be required, you can attach a custom function attached to the hook "cred_form_validate", so that the values of those fields are not empty:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

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

regards,
Waqar