Home › Forums › Quform WordPress › Multiple text areas with word count › Reply To: Multiple text areas with word count
November 16, 2023 at 9:55 am #36228
metaphase
Participant
Thanks, although I cant get this working. I am guessing I also need to do something thats in my other code snippet, currently:
add_filter(‘quform_element_valid_1_5’, function ($valid, $value, Quform_Element_Field $element) {
$max = 300;
$count = preg_match_all(‘/\S+/’, $value);
if ($count > $max) {
$element->addError(“Please enter no more than $max words”);
$valid = false;
}
return $valid;
}, 10, 3);