• Resolved mestres

    (@mestres)


    Hi, I’m developing a contact form to collect some users information. I wish do the part of State and City with Conditional Fields.

    I made the drop-down menu for all the 26 States (Estado in Portuguese)

    <label> Estado*
    [select* Estado “Acre” “Alagoas” “Amapá” “Amazonas” “Bahia” “Ceará” “Distrito Federal” “Espírito Santo” “Goiás” “Maranhão” “Mato Grosso” “Mato Grosso do Sul” “Minas Gerais” “Pará” “Paraíba” “Paraná” “Pernambuco” “Piauí” “Rio de Janeiro” “Rio Grande do Norte” “Rio Grande do Sul” “Rondônia” “Roraima” “Santa Catarina” “São Paulo” “Sergipe” “Tocantins”] </label>

    <label> Cidade* </label> (Cidade is city in portuguese)
    [group Acre]
    [select* Cidade “Acrelândia” “Assis Brasil” “Brasileia”]
    [/group]

    [group Alagoas]
    [select* Cidade “Água Branca” “Anadia” “Arapiraca”]
    [/group]

    This is only a part of the code. I made the 26 groups with all the cities of each one.

    I used the same entry “Cidade” for all the groups. The form works perfectly but the city information is being storaged wrong. It always takes the first entry of the last group, it doens’t matter which state or city I choose. How do I fix this issue if I need only one entry for City(in my case Cidade)? If not I will create 26 different entries for Cities and it doesn’t look to me the right way for a form.

    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)

    You’re correct, if you want to do this with the plugin, you need to rename all your fields.

    It’s not the best use case for conditional fields. You might have more luck implementing it with cascading drop-down lists: https://bdwm.be/how-to-create-dynamically-populated-cascading-dropdown-lists-for-contact-form-7/

    Thread Starter mestres

    (@mestres)

    Thank you for the fast answer!!!

    It’s look a perfect solution. I can easily create the CSV file, instead it will be a huge work. However I’m not an advanced programmer. And the java script part to me it’s kind hard. Is there another plugin that can do the same dynamically fields?

    Plugin Author Jules Colle

    (@jules-colle)

    Not that I’m aware of. But it’s a common enough use case so I will probably include a way to do this in the future. For now, your best bet is probably to hire a developer to code it for you.

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

The topic ‘Conditional field – Dropdown menu – Same entry’ is closed to new replies.