Skip Navigation

[Resolved] Ignore Required Fields when saving as Draft

This support ticket is created 6 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by KentS9937 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1145196

I am trying to create a very long job application form which needs to have the ability for users to save it as a draft and edit it again later. But I also need to have required fields which are tested when they finally submit (Publish) the form.

Is there a way when saving a form as a draft the testing of required fields can be ignored? I see this question has been asked over the years, but not lately. I'm hoping it's a capability which has been added. If not, are there any creative approaches to address this?

#1145574

Hello,

I assume we are talking about this case:

1) A custom post type, with a required custom field, for example: single line field "my-field"

2) A post form for for editing post, with above "my-field" field:
[cred_field field="my-field" ...]

3) You are going to submit this form without filling value into "my-field" field

If it is, I suggest you use generic field shortcode [cred_generic_field] to replace [cred_field] shortcode , for example:

[cred_generic_field field="wpcf-my-field" type="textfield" class=""]
{
"required":0,
"validate_format":0,
"default":"",
"persist":1
}
[/cred_generic_field]

Please replace "my-field" with your custom field slug

More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_generic_field

#1145796

Yes, you have stated my case correctly. But I'm sorry, I don't follow how using a generic field helps me. How does that allow the user to save/submit the form when only some of the required fields are filled in?

#1146308

As you can see, in the cred_generic_field shortcode I mentioned above:
https://toolset.com/forums/topic/ignore-required-fields-when-saving-as-draft/#post-1145574

There is a parameter "persist":1, it will be able to save the field value into database, after user submit the form.

And the parameter "required":0 will setup cred_generic_field as a non-required field.

So the user will be able to submit the form without input value into the field "my-field".

Hope it is clear.

#1149251

My issue is resolved now. Thank you!