Created
July 4, 2025 06:52
-
-
Save aimahdi/b4536bd764c24418214a124f6dbd37ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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