• Resolved julienbarreira

    (@julienbarreira)


    Hello,

    Since I updated my plugins on November 17th, my form is now broken and no email is sent anymore.
    I have nested fields with different email addresses based on selection liek this:

    <div class="form-item">            
        <div class="item-label">
            <label for="nom">Name *</label>
        </div>
        <div class="item-input">
            [text* your-name]
        </div>
    </div>
    <div class="form-item">            
        <div class="item-label">
            <label for="email">Email *</label>
        </div>
        <div class="item-input">
            [email* your-email]
        </div>
    </div>
    <div class="form-item">            
        <div class="item-label">
            <label for="">Test *</label>
        </div>
        <div class="item-input">
            [select* test-1 "Email|[email protected]" "Condition"]
        </div>
    </div>
    
    [group nested-group]
        <fieldset>                        
            <legend>Nested test *</legend>
           [radio test-2use_label_element "Email 1|[email protected]" "Email 2|[email protected]"]
        </fieldset>
    [/group]
    
    <div class="form-item">            
        <div class="item-label">
            <label for="objet">Subject *</label>
        </div>
        <div class="item-input">
            [text* your-subject]
        </div>
    </div>
    <div class="form-item">            
        <div class="item-label">
            <label for="your-message">Message *</label>
        </div>
        <div class="item-input">
            [textarea* your-message]
        </div>
    </div>
    [honeypot email]
    <div class="form-item form-submit">
        <div class="submit">
            [submit class:btn-main "Send"]
        </div>
    </div>

    Here’s the conditional rule of this example:
    show [nested-group] if [test-1] equals "Condition"

    And here’s what I have in the “to” field:
    [test-1], [test-2]

    This case was working perfectly before I updated the plugins.
    I guess the problem is the [test-2] field is not required because it appears conditionally, and the fields in the “to” field should be required.

    There’s no error message when I send the form, it reacts like it’s working perfectly, but the email is not sent. If I remove “[test-2]” in the “to” field, the mail is sent.

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Your radiobutton is now named test-2use_label_element

    You probably forgot to add a space.

    Thread Starter julienbarreira

    (@julienbarreira)

    Thanks for your answer, you’re right there was a typo.
    But the problem is still valid, I gave you a sample code to show you the problem more clearly because the form we have in production is much more complex. As I said, the form was perfectly working for months before the update.

    After performing additional tests here’s what I found:

    1 – The field “test-1” is not valid because the “Condition” option needs to have an email associated to it, otherwise no email will be sent. So I changed it to this:
    [select* test-1 "Email|[email protected]" "Condition|[email protected]"]
    2 – If one of the fields associated with emails isn’t visible, no email will be sent at all.

    So after I make the described change, here’s what happens:

    • If I select “Email” in the “test-1” field, no email will be sent because no value is set for “test-2”
    • If I select “Condition” in the “test-1” field and any value in the “test-2” field, an email will be sent to the email associated to the “test-2” field, and another one to the email associated to the “test-1” field. (so “[email protected]” and [email protected]”)

    I hope this is clear enough.

    Thread Starter julienbarreira

    (@julienbarreira)

    If it can help you, I also tried to change the “to” field to:
    [test-1],[nested-group][email protected][/nested-group]

    • If I select “Condition” in the “test-1” field, both emails are sent (if the “Condition” option has an email associated with pipe, else no email is sent).
    • If I select “Email” on the “test-1” field, no email is sent.
    Thread Starter julienbarreira

    (@julienbarreira)

    Ok I think I found a temporary solution, here’s the form:

    <div class="form-item">            
        <div class="item-label">
            <label for="nom">Name *</label>
        </div>
        <div class="item-input">
            [text* your-name]
        </div>
    </div>
    <div class="form-item">            
        <div class="item-label">
            <label for="email">Email *</label>
        </div>
        <div class="item-input">
            [email* your-email]
        </div>
    </div>
    <div class="form-item">            
        <div class="item-label">
            <label for="">Test *</label>
        </div>
        <div class="item-input">
            [select* test-1 "Email" "Condition"]
        </div>
    </div>
    
    [group nested-group]
        <fieldset>                        
            <legend>Nested test *</legend>
           [radio test-2use_label_element "Email 1" "Email 2"]
        </fieldset>
    [/group]
    
    [group email-1]<div class="d-none"></div>[/group]
    [group email-2]<div class="d-none"></div>[/group]
    [group email-3]<div class="d-none"></div>[/group]
    
    <div class="form-item">            
        <div class="item-label">
            <label for="objet">Subject *</label>
        </div>
        <div class="item-input">
            [text* your-subject]
        </div>
    </div>
    <div class="form-item">            
        <div class="item-label">
            <label for="your-message">Message *</label>
        </div>
        <div class="item-input">
            [textarea* your-message]
        </div>
    </div>
    [honeypot email]
    <div class="form-item form-submit">
        <div class="submit">
            [submit class:btn-main "Send"]
        </div>
    </div>

    The conditional fields:

    show [nested-group] if [test-1] equals "Condition"
    show [email-1] if [test-1] equals "Email"
    show [email-2] if [test-2] equals "Email 1"
               and if [test-1] equals "Condition"
    show [email-3] if [test-2] equals "Email 2"
               and if [test-1] equals "Condition"

    And the “to” field:
    [email-1][email protected][/email-1][email-2][email protected][/email-2][email-3][email protected][/email-3]

    As you can see, I’m showing groups based on the select and radios, and then sending to a different mail for each visible group.
    This is a bit tweaky because I have to add a invisible div in each group for this to work (nothing is sent if they are empty), but at least it works.

    What we had before was cleaner and easier to setup/maintain so I think this remains an interesting issue to investigate.

    Plugin Author Jules Colle

    (@jules-colle)

    I’m sorry but this thread is a bit confusing to me. If you could get to the gist of the problem with a very basic example form code and conditions, and let me know what you expect to happen, I can turn this into a simple test-case.

    If you want you can use the form-tester to create a form to demonstrate your problem. https://conditional-fields-cf7.bdwm.be/form-tester/?test-form=blank+form

    • This reply was modified 3 years, 10 months ago by Jules Colle.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Nested groups with email selection radios not working anymore’ is closed to new replies.