Tell us what you are trying to do?
Hi Waqar,
sorry that I have to claim you again. The code you gave me to add the total number of checked boxes in each categorie is not working.
add_action('cred_save_data','func_connect_child_posts',15,2);
function func_connect_child_posts($post_id,$form_data) {
if ($form_data['id']==339) {
$field-1 = $_POST['wpcf-count-checkboxes-auto-verkehr'];
$field-2 = $_POST['wpcf-count-checkboxes-bauen-renovieren'];
$field-3 = $_POST['wpcf-count-checkboxes-behoerden-verbaende'];
$sum = $field-1 + $field-2 + $field-3;
update_post_meta($post_id, 'wpcf-count-checkboxes-gesamtzahl', $sum);
}
}
There is an error message in the "Custom code snippets - Settings" and the the field "count-checkboxes-gesamtzahl" remains empty in the form:
[2020-10-12 13:01:41, frontend] syntax error, unexpected '=' in /homepages/15/d845764028/htdocs/clickandbuilds/FirmeninfoRegional/wp-content/toolset-customizations/count-checkboxes-total.php on line 15.
A problem occurred when executing snippet "count-checkboxes-total". The result of include_once is: ""
(I've attached a screenshot of the error message)
I've tried something out myself but couldn't come up with a solution. Hope you can help me again.
Is there any documentation that you are following?
Earlier support ticket "How to count number of selected chechboxes "
https://toolset.com/forums/topic/how-to-count-number-of-selected-chechboxes/
Thank you in advance for your further help.
Jenny
Is there a similar example that we can see?
No
What is the link to your site?
hidden link