• Resolved kingsdavid

    (@kingsdavid)


    Hello,
    In my form, depending on the age of the user, the email field is mandatory or optional.
    So I created a condition to display the mandatory or optional fields depending on the age.

    [checkbox eleve use_label_element exclusive “Mineur ” “Majeur”]

    [group elevemineur]
    Email : [email email]
    [/group]

    [group elevemajeur]
    Email* : [email* email]
    [/group]

    The display works correctly but the code does not work, the email field is considered optional regardless of the age chosen (minor or adult).

    The asterisk (*) of [email* email] is not taken into account.

    Of course, I can create two different names email_minor and email_major but I need to have a single item for display in a single column of a table afterwards.

    Do you have an idea to solve this problem?

    You can see the form page here :
    https://www.embba.fr/test2/

    My WP theme is Bravada

    Thank you

    The page I need help with: [log in to see the link]

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

    (@jules-colle)

    Hi, All field names should be unique.

    If you want to work around this you can use a different name for both email fields (for example email-1 and email-2) and in the Mail or To field add this:

    [elevemineur][email-1][/elevemineur][elevemajeur][email-2][/elevemajeur]

    Alternatively you can upgrade to PRO and simply use the disable_on_hide property on the groups the https://conditional-fields-cf7.bdwm.be/disable_on_hide/

    Thread Starter kingsdavid

    (@kingsdavid)

    Ok but the pro version is horribly expensive for only needing one function. Plus, there’s even the option to purchase a lifetime license. ??

    Plugin Author Jules Colle

    (@jules-colle)

    So use the first option. it works just as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional field problem when mandatory or optional’ is closed to new replies.