My forms are working fantastic and this plugin is brilliant! Formidable completely powers my site and I am so happy I found it! I have a question regarding front-end posts. I am running into “tag abuse” by some of my users, forcing me to have to edit some posts however I am looking for a way to limit the character or word count on the tag field . Is there a simple way to accomplish this?
Thank you!




October 10, 2012 at 10:34 am
You can do this fairly easily with a bit of custom code. you would want to add this to your theme's functions.php file or to a new plugin:
add_filter('frm_validate_field_entry', 'my_custom_validation', 10, 3); function my_custom_validation($errors, $posted_field, $posted_value){ if($posted_field->id == 25){ //change 25 to the ID of the field to validate //check the $posted_value here $words = explode(' ', $posted_value); //separate at each space $count = count($words); //count each word //if it doesn't match up, add an error: if($count > 3) //change 3 to the max number of tags $errors['field'. $posted_field->id] = 'Please limit your number of tags to 3 or less.'; } return $errors; }Make sure you switch out the 25 for the id of your tags field, and change the 3 to the number of words you want users to be limited to.
Topic closed.