Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aimahdi/b4536bd764c24418214a124f6dbd37ad to your computer and use it in GitHub Desktop.
Save aimahdi/b4536bd764c24418214a124f6dbd37ad to your computer and use it in GitHub Desktop.
add_filter('fluentform/validate_input_item_input_checkbox', function($validation, $field, $formData, $fields, $form) {
// Do your stuff here
//
$formId = $form->id;
if($formId != 6) return $validation; // Change the form id here
$count = count($formData['checkbox']); //replace checkbox with the name attribute of the field
if($count<3) return 'Please select all the options'; //update your message and replace 3 with total option in the checkbox
return $validation;
}, 10, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment