Title: Required fields nested under conditional groups
Last modified: April 28, 2017

---

# Required fields nested under conditional groups

 *  Resolved [smschick](https://wordpress.org/support/users/smschick/)
 * (@smschick)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/)
 * I have started developing a request form where you have some general form fields
   and then other fields that will show up based on the project request type that
   is chosen from a select/drop down. All is fine but there are required elements
   that are nested within conditional groups and those required elements that are
   nested do not maintain their required status. The form will successfully submit
   without them having value. I’ve moved the same form fields out of the conditional
   groups and they then honor the required validation. Shouldn’t the conditional
   fields plugin honor the required fields if that particular group is being shown?

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

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9080639)
 * It was working like this before, but people gave me a lot of trash about this
   in the beginning. Most people expect the required fields not to be honored if
   they are invisible. The work around is, I guess, to make sure that the fields
   that trigger the group containing a required field, are also required. I would
   like to see a live example of what you are willing to achieve. Then maybe I can
   give you a code snippet you could insert into your theme’s functions.php file
   to cancel this behavior.
 *  Thread Starter [smschick](https://wordpress.org/support/users/smschick/)
 * (@smschick)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9122627)
 * Hello Jules, sorry for the delayed response! Here is a link to the request form
   I’ve created. [http://aquentstudiosatrockwel.apps-1and1.com/projectrequest](http://aquentstudiosatrockwel.apps-1and1.com/projectrequest)
 * The fields at the top half are general fields that pertain to all three request
   types that you choose from — the dropdown/select field “project request type”—
   that is also a required field as you suggested. I currently have it in demo mode
   right now so no emails are being sent or entries stored in Flamingo.
 * The required items that are conditional based on the project request type are
   the fields that are being submitted regardless of being blank or not.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9124987)
 * now i see. even the visible fields are not triggering validation errors. this
   shouldn’t happen indeed. i will check what’s going on
 *  Thread Starter [smschick](https://wordpress.org/support/users/smschick/)
 * (@smschick)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9125077)
 * That would be great, thank you so much. Just to clarify only the visible required
   fields should trigger the validation.
 * One other thing the conditional logic does not work at all in the mail output.
   Anything wrapped in groups per the documentation just does not appear in the 
   emails. Not as big of a deal as I can simplify the confirmation emails to the
   submitter but it would be super nice if I could give them a clean email with 
   what they submitted.
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9125128)
 * I checked again, and it’s still working like this by default. See [http://bdwm.be/wpcf7cf/simple-form/](http://bdwm.be/wpcf7cf/simple-form/)
 * So there has to be some kind of conflict with another plugin or something is 
   wrong with the way you set up your form. Can you share the form code and conditions
   with me please?
 *  Thread Starter [smschick](https://wordpress.org/support/users/smschick/)
 * (@smschick)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9125254)
 * Yes of course, here is the code:
 * <div class=”col-1″>
    <label for=”prf-name”>Name<span class=”required”>*</span
   ></label> [text* prf-name akismet:author] </div>
 * <div class=”col-2 left”>
    <label for=”prf-email”>Email<span class=”required”>*
   </span></label> [email* prf-email placeholder akismet:author_email “YourEmail@ra.
   rockwell.com”] </div>
 * <div class=”col-2 right”>
    <label for=”prf-phone”>Phone<span class=”required”
   >*</span></label> [tel* prf-phone] </div>
 * <div class=”col-2 left”>
    <label for=”prf-city”>City</label> [text prf-city] 
   </div>
 * <div class=”col-2 right”>
    <label for=”prf-officeloc”>Office Location<span class
   =”required”>*</span></label> [text* prf-officeloc] </div>
 * <div class=”col-2 left”>
    <label for=”prf-cost-center”>Cost Center/ Department
   <span class=”required”>*</span></label> [text* prf-cost-center] </div>
 * <div class=”col-2 right”>
    <label for=”prf-wbs”>WBS Number</label> [text prf-
   wbs]<div class=”desc”>Marketing Only</div> </div>
 * <div class=”col-1″>
    <label for=”prf-request-type”>Project Request Type<span 
   class=”required”>*</span></label> [select* prf-request-type include_blank “General”“
   IDW MediaBin Photo” “Webcast”] </div>
 * [group group-all]
    <div class=”col-1″> [group group-general] <label for=”prf-
   project-name”>Project Name<span class=”required”>*</span></label> [/group] [group
   group-photo] <label for=”prf-project-name”>Product Name<span class=”required”
   >*</span></label> [/group] [group group-webcast] <label for=”prf-project-name”
   >Webcast Name<span class=”required”>*</span></label> [/group] [text* prf-project-
   name] </div>
 *  [group group-general]
    <div class=”col-1″> <label for=”prf-general-type”> Project
   Type<span class=”required”>*</span></label> [checkbox* prf-general-type “Print”“
   Print w/Translations” “Multimedia” “Photography” “Web” “Audio/Video” “MediaBin(
   Images for web use)”] </div> [/group] [group group-photo] <div class=”col-1″>
   <label for=”prf-photo-type”> Project Type<span class=”required”>*</span></label
   > [checkbox* prf-photo-type exclusive “Photography and MediaBin submittal” “MediaBin
   submittal only (photo already exists)”] </div> [/group] [group group-webcast]
   <div class=”col-1″> <label for=”prf-webcast-type”> Project Type<span class=”required”
   >*</span></label> [checkbox* prf-webcast-type exclusive “Audio and video” “Audio
   only”] </div> [/group]
 *  [group group-webcast]
    <div class=”col-2 left”> <label for=”prf-webcast-date”
   > Webcast Date<span class=”required”>*</span></label> [date* prf-webcast-date]
   </div> <div class=”col-2 right”> <label for=”prf-webcast-duration”> Duration<
   span class=”required”>*</span></label> [number* prf-webcast-duration]<div class
   =”desc”>The amount of time (in minutes) for the webcast to run.</div> </div>
 *  <div class=”col-1″>
    <label for=”prf-webcast-locations”> Webcast Location(s)
   <span class=”required”>*</span></label> [textarea* prf-webcast-locations x4] 
   </div> [/group]
 *  <div class=”col-1″>
    [group group-general] <label for=”prf-description”> Description
   <span class=”required”>*</span></label> [/group] [group group-photo] <label for
   =”prf-description”> Special Instructions<span class=”required”>*</span></label
   > [/group] [group group-webcast] <label for=”prf-description”> Description<span
   class=”required”>*</span></label> [/group] [textarea* prf-description x4][group
   group-webcast]<div class=”desc”>Note any additional requirements like remote 
   presenters, video playback, desktop sharing etc.</div>[/group] </div>
 *  [group group-general]
    <div class=”col-2 left”> <label for=”prf-general-first-
   deadline”> First Review Deadline<span class=”required”>*</span></label> [date*
   prf-general-first-deadline] </div> <div class=”col-2 right”> <label for=”prf-
   general-final-deadline”> Final Deadline<span class=”required”>*</span></label
   > [date* prf-general-final-deadline] </div> [/group] [/group]
 * <div class=”col-1″>
    [recaptcha] </div> <div class=”col-1″> [submit “Send”] </
   div>
 * Conditions:
    WordPress version 4.7.4
 * These are the active plugins on my site:
    Akismet Anti-Spam – v 3.3.2 Contact
   Form 7 – v 4.8-dev Contact Form 7 Conditional Fields – v 1.3.2 Flamingo – v 1.5
   SVG Support – v 2.3.8 TinyMCE Advanced – v 4.5.6
 *  Thread Starter [smschick](https://wordpress.org/support/users/smschick/)
 * (@smschick)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9125576)
 * Hi Jules,
    Wanted to give you a heads up after reviewing my own conditions that
   I sent to you I noticed the 4.8 dev version of CF7. Not sure how I installed 
   the dev build as it CF7 came preinstalled with my word press build… Regardless
   I downgraded to the official 4.7 release and all is working as it should!
 * hopefully when 4.8 goes live it won’t break again! Thanks again for all your 
   fast/good support. Is there a donate/support link on your plugin page?
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9125674)
 * you’re welcome! there is a donate button but I would appreciate a nice review
   even more 😉
 *  Thread Starter [smschick](https://wordpress.org/support/users/smschick/)
 * (@smschick)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9125683)
 * consider it done
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9127179)
 * thank you so very much! 🙂
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9127181)
 * ps: please open a new topic if the problem remains. i don’t get email updates
   from this forum so i might miss any other posts here.

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

The topic ‘Required fields nested under conditional groups’ is closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/required-fields-nested-under-conditional-groups/#post-9127181)
 * Status: resolved