character limit in textarea contact form 7
-
hi i found this code
add_filter( 'wpcf7_validate_textarea', 'character_length_validation_filter', 11, 2 ); add_filter( 'wpcf7_validate_textarea*', 'character_length_validation_filter', 11, 2 ); function character_length_validation_filter( $result, $tag ) { $name = $tag['name']; if ( ! $result['valid'] ) return $result; if ( 400 < strlen( $_POST[$name] ) ) { $result['valid'] = false; $result['reason'][$name] = "Too long."; } return $result; }
but there is a problem in this code its for all textarea i want this work for specific textarea [textarea* textarea-short] what should i do for that
thankyou
- The topic ‘character limit in textarea contact form 7’ is closed to new replies.