Skip Navigation

[Resolved] how to make taxonomy select box required?

This support ticket is created 3 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
- 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 2 replies, has 2 voices.

Last updated by kimheleek 3 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2206639

Hi, I need help
I'm trying to make cred form
and I need required taxonomy select box and show up the error message but I can't don't know how

I added this filter in functions.php

add_filter('cred_form_validate','price_validation',10,2);
function price_validation($field_data, $form_data) {
list($fields,$errors)=$field_data;
if ($form_data['id']==5031) {
if (empty($fields['price']['value'][0]))
$errors['price']='Please select a topic';
}
return array($fields,$errors);
}

and this is cred field
[cred_field field='price' force_type='taxonomy' output='bootstrap' display='select' single_select='true' data-parsley-required="true" ]

Is there any documentation that you are following?
Yes it is
https://toolset.com/forums/topic/make-single-select-taxonomy-a-required-field-in-post-form/

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2207589

Hello,

Since it is a custom codes issue, please provide your website credentials in below private message box, also point out where I can edit your custom PHP codes.

#2217261

My issue is resolved now. Thank you!