• Resolved irishtom

    (@irishtom)


    Hi Jules, a bit of an odd one:

    We’re using Conditional Fields to show a ‘State’ select field if a user selects ‘United States’ from a ‘Country’ select field.

    The group is set to clear_on_hide and, 90% of the time, everything works as expected.

    However, every so often the state field populates with a US state, even if the country is set to a country that isn’t the United States. So we end up with Austria and Idaho in our email submission. The actual state that gets selected seems entirely random.

    If it was just an oddity in the email replies we receive I wouldn’t be so worried but our CF7 forms are hooked up to Salesforce and Salesforce refuses to create new a lead if you try and submit a US state for a non-US country.

    There are no js or PHP errors that I can see and, because it’s intermittent, it’s very difficult to replicate the error. I can’t tell if it’s a specific browser issue or anything.

    Here’s the form code:

    <label class="full-center"> First Name <small>(required)</small>
        [text* your-first-name] </label>
    
    <label class="full-center"> Last Name <small>(required)</small>
        [text* your-last-name] </label>
    
    <label class="full-center">Email <small>(required)</small>
        [email* your-email] </label>
    
    <label class="full-center">Telephone
        [tel your-tel] </label>
    
    <label class="full-center">Company <small>(required)</small>
        [text* your-company] </label>
    
    <label class="full-center"> Country <small>(required)</small>
    [select* your-country include_blank 
    "United Kingdom" "United States" "India" "Singapore" "Afghanistan" "Aland Islands" "Albania" "Algeria" "Andorra" "Angola" "Anguilla" "Antarctica" "Antigua and Barbuda" "Argentina" "Armenia" "Aruba" "Australia" "Austria" "Azerbaijan" "Bahamas" "Bahrain" "Bangladesh" "Barbados" "Belarus" "Belgium" "Belize" "Benin" "Bermuda" "Bhutan" "Bolivia, Plurinational State of" "Bonaire, Sint Eustatius and Saba" "Bosnia and Herzegovina" "Botswana" "Bouvet Island" "Brazil" "British Indian Ocean Territory" "Brunei Darussalam" "Bulgaria" "Burkina Faso" "Burundi" "Cambodia" "Cameroon" "Canada" "Cape Verde" "Cayman Islands" "Central African Republic" "Chad" "Chile" "China" "Chinese Taipei" "Christmas Island" "Cocos (Keeling) Islands" "Colombia" "Comoros" "Congo" "Congo, the Democratic Republic of the" "Cook Islands" "Costa Rica" "Cote d'Ivoire" "Croatia" "Cuba" "Curaçao" "Cyprus" "Czech Republic" "Denmark" "Djibouti" "Dominica" "Dominican Republic" "Ecuador" "Egypt" "El Salvador" "Equatorial Guinea" "Eritrea" "Estonia" "Ethiopia" "Falkland Islands (Malvinas)" "Faroe Islands" "Fiji" "Finland" "France" "French Guiana" "French Polynesia" "French Southern Territories" "Gabon" "Gambia" "Georgia" "Germany" "Ghana" "Gibraltar" "Greece" "Greenland" "Grenada" "Guadeloupe" "Guatemala" "Guernsey" "Guinea" "Guinea-Bissau" "Guyana" "Haiti" "Heard Island and McDonald Islands" "Holy See (Vatican City State)" "Honduras" "Hungary" "Iceland" "Indonesia" "Iran, Islamic Republic of" "Iraq" "Ireland" "Isle of Man" "Israel" "Italy" "Jamaica" "Japan" "Jersey" "Jordan" "Kazakhstan" "Kenya" "Kiribati" "Korea, Democratic People's Republic of" "Korea, Republic of" "Kuwait" "Kyrgyzstan" "Lao People's Democratic Republic" "Latvia" "Lebanon" "Lesotho" "Liberia" "Libyan Arab Jamahiriya" "Liechtenstein" "Lithuania" "Luxembourg" "Macao" "Macedonia, the former Yugoslav Republic of" "Madagascar" "Malawi" "Malaysia" "Maldives" "Mali" "Malta" "Martinique" "Mauritania" "Mauritius" "Mayotte" "Mexico" "Moldova, Republic of" "Monaco" "Mongolia" "Montenegro" "Montserrat" "Morocco" "Mozambique" "Myanmar" "Namibia" "Nauru" "Nepal" "Netherlands" "New Caledonia" "New Zealand" "Nicaragua" "Niger" "Nigeria" "Niue" "Norfolk Island" "Norway" "Oman" "Pakistan" "Palestinian Territory, Occupied" "Panama" "Papua New Guinea" "Paraguay" "Peru" "Philippines" "Pitcairn" "Poland" "Portugal" "Qatar" "Reunion" "Romania" "Russian Federation" "Rwanda" "Saint Barthélemy" "Saint Helena, Ascension and Tristan da Cunha" "Saint Kitts and Nevis" "Saint Lucia" "Saint Martin (French part)" "Saint Pierre and Miquelon" "Saint Vincent and the Grenadines" "Samoa" "San Marino" "Sao Tome and Principe" "Saudi Arabia" "Senegal" "Serbia" "Seychelles" "Sierra Leone" "Sint Maarten (Dutch part)" "Slovakia" "Slovenia" "Solomon Islands" "Somalia" "South Africa" "South Georgia and the South Sandwich Islands" "South Sudan" "Spain" "Sri Lanka" "Sudan" "Suriname" "Svalbard and Jan Mayen" "Swaziland" "Sweden" "Switzerland" "Syrian Arab Republic" "Tajikistan" "Tanzania, United Republic of" "Thailand" "Timor-Leste" "Togo" "Tokelau" "Tonga" "Trinidad and Tobago" "Tunisia" "Turkey" "Turkmenistan" "Turks and Caicos Islands" "Tuvalu" "Uganda" "Ukraine" "United Arab Emirates" "Uruguay" "Uzbekistan" "Vanuatu" "Venezuela, Bolivarian Republic of" "Viet Nam" "Virgin Islands, British" "Wallis and Futuna" "Western Sahara" "Yemen" "Zambia" "Zimbabwe"]</label>
    
    [group us-state clear_on_hide]
    <p style="margin-bottom:25px;" class="full-center"><label> State <small>(required)</small>
    [select your-state include_blank "Alabama" "Alaska" "Arizona" "Arkansas" "California" "Colorado" "Connecticut" "Delaware" "Florida" "Georgia" "Hawaii" "Idaho" "Illinois" "Indiana" "Iowa" "Kansas" "Kentucky" "Louisiana" "Maine" "Maryland" "Massachusetts" "Michigan" "Minnesota" "Mississippi" "Missouri" "Montana" "Nebraska" "Nevada" "New Hampshire" "New Jersey" "New Mexico" "New York" "North Carolina" "North Dakota" "Ohio" "Oklahoma" "Oregon" "Pennsylvania" "Rhode Island" "South Carolina" "South Dakota" "Tennessee" "Texas" "Utah" "Vermont" "Virginia" "Washington" "West Virginia" "Wisconsin" "Wyoming"]</label></p>
    [/group]
    
    <p style="margin-bottom:25px;" class="full-center"><label>Industry <small>(required)</small>
    [select* your-industry include_blank "Pharma" "Clinical Trials" "Logistics" "Other"]</label></p>
    
    <label class="full-center"> Your Message <small>(required)</small>
        [textarea* your-message] </label>
    
    [acceptance email-signup optional] Subscribe to email updates [/acceptance]
    
    [submit "Send"]

    Is there anything obvious from the above that could be causing it?

    We’ve tried making the State select required and not required but it doesn’t seem to make a difference.

    Any ideas would be greatly appreciated.

    Thanks for your help.

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

    (@jules-colle)

    Nothing wrong with your form on first sight.

    It is possible that this is browser related. The JavaScript used is aimed at modern webkit browsers like Edge FF and Chrome. Every now and then somebody reports that something isn’t working on IE, I then add a polyfill to fix the issue. As long as I don’t know the exact browser that produces the error there’s not much I can do. It’s good to have this issue open though. If somebody could run some tests on the above form for some non-standard browsers, feel free to report you experiences here.

    Also feel free to use this tool for testing: https://conditional-fields-cf7.bdwm.be/form-tester/?hash=142b1e1dce3b70c52832073891a50bb1

Viewing 1 replies (of 1 total)

The topic ‘Intermittent issue with conditional select field’ is closed to new replies.