Support » Plugin: Contact Form 7 - Conditional Fields Pro » Required text fields inside a group

  • Resolved lollorome

    (@lollorome)


    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

    (@jules-colle)

    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.

    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

    (@jules-colle)

    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?

    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 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

    (@jules-colle)

    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

    (@jules-colle)

    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

    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

    (@jules-colle)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Required text fields inside a group’ is closed to new replies.