Title: Required text fields inside a group
Last modified: September 8, 2018

---

# Required text fields inside a group

 *  Resolved [lollorome](https://wordpress.org/support/users/lollorome/)
 * (@lollorome)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/)
 * Hi there and thanks for this good plug-in,
    Required* fields inside a group don’t
   work, is it normal?
 * Check my code:
 *     ```
       [select* numero-partecipanti include_blank "da 1 a 6 partecipanti" "da 6 a 12 partecipanti" "da 12 a 18 partecipanti" "da 18 a 26 partecipanti"]
   
       [group fino-6]
          [text* istr1 placeholder "Nome e Cognome 1° istruttore"]
       [/group]
   
       [group fino-12]
          [text* istr1 placeholder "Nome e Cognome 1° istruttore"]
          [text* istr2 placeholder "Nome e Cognome 2° istruttore"]
       [/group]
   
       [group fino-18]
          [text* istr1 placeholder "Nome e Cognome 1° istruttore"]
          [text* istr2 placeholder "Nome e Cognome 2° istruttore"]
          [text* istr3 placeholder "Nome e Cognome 3° istruttore"]
       [/group]
   
       [group fino-24]
          [text* istr1 placeholder "Nome e Cognome 1° istruttore"]
          [text* istr2 placeholder "Nome e Cognome 2° istruttore"]
          [text* istr3 placeholder "Nome e Cognome 3° istruttore"]
          [text* istr4 placeholder "Nome e Cognome 4° istruttore"]
       [/group]
       ```
   
 * If user check 1° select options will see [group fino-6], 2° select option > [
   group fino-12] and more and more until 4° select option.
 * Text fields inside groups need to be required.
 * How can I do this?
    Thanks again

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

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10681236)
 * It was initially working like you want it. But by popular demand validation is
   not triggered if required fields are hidden. Since most people tend to use the
   plugin as show-only. I am going to make this optional as I will be extending 
   the plugin with some native multi-page support in the future.
 * For now, you are stuck though, so if you really need to validate hidden fields,
   you will need to fork the code or create your own.
 *  [nero2001](https://wordpress.org/support/users/nero2001/)
 * (@nero2001)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10745284)
 * Hi,
    I have the same problem. I need to insert the required fields in the group,
   but it doesn’t work. Please, could you make this function optional?
 * Thank you!
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10745421)
 * I’ll think about it. Would you expect the group to fold open again if validation
   of one of its elements fails? Or should this be optional too?
 *  [nero2001](https://wordpress.org/support/users/nero2001/)
 * (@nero2001)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10745659)
 * Hi Jules,
    In my case I just need the validation to be confirmed only if “all
   the fields required” are filled in. Even the elements inside the group.
 * In your [tutorial](https://conditional-fields-cf7.bdwm.be/conditional-fields-for-contact-form-7-tutorial/)
   the contact form works exactly like I need it to. There is a conditional field
   that must be filled in or the validation is not possible and an alert message
   comes out to inform of that.
 * Thank you
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10745840)
 * If it works in the tutorial like you want, then why don’t you just implement 
   it like in the tutorial?
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10745855)
 * OK, I see the confusion now. I didn’t check the original question properly. The
   problem there was that there were duplicate names.
 * You are allowed to place required fields inside groups. If the group is visible
   during submit a validation error will be triggered, if the group is hidden during
   submission, no errors are thrown. This is how the plugin works by default and
   this is probably the behaviour you want to. Just add required fields in the groups,
   but make sure all fields have a unique name
 *  [nero2001](https://wordpress.org/support/users/nero2001/)
 * (@nero2001)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10746718)
 * Hi Jules,
 * you’re right, giving a unique name to each module now works!
    But doing so I 
   will have several mail-tags very similar to each other, such as date1, date2 
   and date3, etc.. How will I fill in the email? Will I have to insert all the 
   mail-tags? How could I enter only the tag that is compiled?
 * Thank you
 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10746780)
 * you can use group tags in the email message as well. See [https://conditional-fields-cf7.bdwm.be/conditional-fields-for-contact-form-7-tutorial/#mail](https://conditional-fields-cf7.bdwm.be/conditional-fields-for-contact-form-7-tutorial/#mail)

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

The topic ‘Required text fields inside a group’ 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/)

## Tags

 * [group](https://wordpress.org/support/topic-tag/group/)
 * [required field](https://wordpress.org/support/topic-tag/required-field/)

 * 8 replies
 * 3 participants
 * Last reply from: [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/required-text-fields-inside-a-group/#post-10746780)
 * Status: resolved