• Resolved smschick

    (@smschick)


    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

    (@jules-colle)

    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

    (@smschick)

    Hello Jules, sorry for the delayed response! Here is a link to the request form I’ve created. https://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

    (@jules-colle)

    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

    (@smschick)

    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

    (@jules-colle)

    I checked again, and it’s still working like this by default. See https://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

    (@smschick)

    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 “[email protected]”]
    </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

    (@smschick)

    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

    (@jules-colle)

    you’re welcome! there is a donate button but I would appreciate a nice review even more ??

    Thread Starter smschick

    (@smschick)

    consider it done

    Plugin Author Jules Colle

    (@jules-colle)

    thank you so very much! ??

    Plugin Author Jules Colle

    (@jules-colle)

    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.