Title: Conditional Custom Form Validation Question
Last modified: August 31, 2016

---

# Conditional Custom Form Validation Question

 *  [madfatter](https://wordpress.org/support/users/madfatter/)
 * (@madfatter)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/conditional-custom-form-validation-question/)
 * My client has a from with some fields that are only required if a certain value
   has been selected. The basic logic is if the user has two options if they selects
   option one it presents them with another select with two options. From there 
   they select an option and have to fill out two required text fields. But those
   are only required based on the selection they made. Otherwise if they’ve chosen
   option two the text fields for that option are required.
 * I’ve looked at the code here [http://contactform7.com/2015/03/28/custom-validation](http://contactform7.com/2015/03/28/custom-validation)
   and I’m not sure if I can access the value of the selects when validating the
   text fields? I admit my coding skills are rudimentary (and a bit rusty) so I 
   hope this isn’t too ignorant a question.
 * Any advice on how or if this could be achieved (or if there’s a smarter way to
   do this) would be very much appreciated.
 * Thanks in advance for any help.
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

The topic ‘Conditional Custom Form Validation Question’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [madfatter](https://wordpress.org/support/users/madfatter/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/conditional-custom-form-validation-question/)
 * Status: not resolved