Title: Form validation doesn&#8217;t stop submit
Last modified: April 3, 2023

---

# Form validation doesn’t stop submit

 *  [mayy3321](https://wordpress.org/support/users/mayy3321/)
 * (@mayy3321)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/form-validation-doesnt-stop-submit/)
 * Is this normal?
 * “Email is invalid”, “___ is too short”
 * But it sends the form anyway.
 * None of the built in checks stop form sending. minlength:8
 * It’s all in the hand written code in the theme. wpcf7_validate_textarea etc
 * Is there a plugin that works for those, instead of having to ftp in files each
   time editing the site?
 * Or a way to read my own minlength:8 and write another function in the theme code?
    -  This topic was modified 3 years, 3 months ago by [mayy3321](https://wordpress.org/support/users/mayy3321/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [mayy3321](https://wordpress.org/support/users/mayy3321/)
 * (@mayy3321)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/form-validation-doesnt-stop-submit/#post-16623484)
 * I already have stuff like
 *     ```wp-block-code
       	if(empty($_POST[$tag->name]) || strlen($_POST[$tag->name]) == 0) {
       		$result->invalidate( $tag, "Field cannot be empty." );
       	}
   
       	return $result;
       ```
   
 * But what’s a good way to do minlength myself? I can’t set them all the same. 
   I’m basically coding the form in php not in the plugin.
 * I guess the recommended contact form 7 way is to write each code? so all emails
   in the theme must be 6 char, or something like that? I’ll have 1 function for
   each type of field.
 * doesn’t help with all the text fields.
    -  This reply was modified 3 years, 3 months ago by [mayy3321](https://wordpress.org/support/users/mayy3321/).
    -  This reply was modified 3 years, 3 months ago by [mayy3321](https://wordpress.org/support/users/mayy3321/).

Viewing 1 replies (of 1 total)

The topic ‘Form validation doesn’t stop submit’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [mayy3321](https://wordpress.org/support/users/mayy3321/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/form-validation-doesnt-stop-submit/#post-16623484)
 * Status: not resolved