Title: Custom Validation
Last modified: January 3, 2020

---

# Custom Validation

 *  Resolved [brozra](https://wordpress.org/support/users/brozra/)
 * (@brozra)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/custom-validation-18/)
 * On this page there is a “Ship By Date” field but the only validation it can do
   is to see if it is empty or not.
 * Is there a hook / filter that I can tie into to validate the field to make sure
   that the date entry is valid and also beyond a certain date? I want to make sure
   that the customers who use this field enter a date that is at least ten (10) 
   working days beyond today’s date.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-validation-18%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [N-Media](https://wordpress.org/support/users/nmedia/)
 * (@nmedia)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/custom-validation-18/#post-12291920)
 * Hi [@brozra](https://wordpress.org/support/users/brozra/),
 * Well, you can do this with little Javascript inside your theme/somewhere:
 *     ```
       var future = new Date();
       future.setDate(future.getDate() + 30);
       jQuery("#date_of_arrival" ).datepicker( "option", "minDate", future );
       ```
   
 *  Thread Starter [brozra](https://wordpress.org/support/users/brozra/)
 * (@brozra)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/custom-validation-18/#post-12293220)
 * I had already thought of that and I’d rather have server-side validation. JS 
   validation is pointless if they can just turn off JS and bypass the validation
   entirely.
 * So what I am looking for is a filter or hook (if they exist) that I can tie into
   to check that particular date field and do custom validation to ensure it is 
   in a date format and also a date on or beyond a calculated date.
 * If it doesn’t exist I can come up with something on my own.
 *  [N-Media](https://wordpress.org/support/users/nmedia/)
 * (@nmedia)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/custom-validation-18/#post-12293426)
 * Ok, but for now server-side validation is not possible.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom Validation’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-product-addon/assets/icon-256x256.gif?rev=3186763)
 * [PPOM - Product Addons & Custom Fields for WooCommerce](https://wordpress.org/plugins/woocommerce-product-addon/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-product-addon/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-product-addon/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-product-addon/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-product-addon/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-product-addon/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [N-Media](https://wordpress.org/support/users/nmedia/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/custom-validation-18/#post-12293426)
 * Status: resolved