This support ticket is created 5 years, 4 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
As I told you in the first message, we used your solution posted here: https://toolset.com/forums/topic/required-cred-checkboxes/ on one form and it actually works. The problem is that it is not working with other forms. The other forms have the same type of checkboxes (those forms are used for posting premium posts, but all of them are created in the same way).
Out question wasn't if it works on our fields (because we saw it work). The question is: How can we make it work on other forms as well?
I'm not sure how this even worked in the first place since we are working taxonomies.
I know our documentation shows this implementation for custom fields. Even your code here
function my_validation($field_data, $form_data)
{
//field data are field values and errors
list($fields,$errors)=$field_data;
//uncomment this if you want to print the field values
//print_r($fields);
//validate if specific form
if ($form_data['id']==25559)
{
//check if field is selected
if (empty($fields['wpcf-type_of_proposal']['value']))
{
//set error message for featured image
$errors['wpcf-type_of_proposal'] = 'Please Specify if you are looking to Buy or Sell';
}
}
//return result
return array($fields,$errors);
}
Works only for custom field. If you check the form you won't find any fields with the name "wpcf-type_of_proposal".
Even as you say in your initial message that it works on the page here. hidden link
When I performed my testing the validation doesn't work at all.
Maybe if you can send a screenshot of this working I will try to see why i'm not seeing it working but your initial code doesn't work. Also from my understanding the validation hook doesn't cover taxonomies.