Skip Navigation

[Resolved] Make a child post select required in a cred form

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

Problem:
How to make a “Select Parent post” field required in a cred child form?

Solution:
You can make the Select Parent Post field required in CRED Child form >> Add Post fields >> Parents >> Required. Screenshot here:
https://toolset.com/wp-content/uploads/2017/08/556019-required_field.png?x71388

Example CRED shortcode looks like this:

 [cred_field field='post_parent' value='' order='date' ordering='desc' required='true' select_text='--- not set ---' validate_text='property must be selected' class='form-control' output='bootstrap'] 
This support ticket is created 7 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by romanB-3 7 years, 3 months ago.

Assisted by: Noman.

Author
Posts
#555981

Hello,
I have a cred post with a select populated with parent posts.
I need this select to be required : if not set the form loads an error message.
Thank you.

#556019

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

required field.png

Hi Roman,

Thank you for contacting Toolset support. Yes, you can make the Select Parent Post field required in CRED Child form >> Add Post fields >> Parents >> Required. Please see attached screenshot.

Here is example code:

[cred_field field='post_parent' value='' order='date' ordering='desc' required='true' select_text='--- not set ---' validate_text='property must be selected' class='form-control' output='bootstrap']

Thank you

#556023

Thank you very much!

Also when I set it required, the error message in French is set on La publication n'a pas été sauvegardée à cause du problème suivant :, but it appears with a "\", like this : La publication n\'a pas été sauvegardée à cause du problème suivant :.

Thank you.

#556029

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Please open a new ticket for this error message with some more details and we will handle this issue separately. This will help other users with similar problems to find solutions when searching the forum, as per support policy. https://toolset.com/toolset-support-policy/

Please kindly mark this current ticket as resolved if Post Parent field is set as Required now.

Thank you.

#556031

Thank you.