Title: Conditional Drop Down
Last modified: April 25, 2017

---

# Conditional Drop Down

 *  Resolved [somethingelse3](https://wordpress.org/support/users/somethingelse3/)
 * (@somethingelse3)
 * [9 years ago](https://wordpress.org/support/topic/conditional-drop-down-2/)
 * I’d like to have a drop down who’s options of choices are conditional of another
   drop down.
 * For example, if I have three drop down menus: 1) State 2) County 3) City. Depending
   on the state they choose in first drop down menu, the form will automatically
   bring in the county’s of that state. Then they’ll select a county, and the city
   drop down menu will populate with cities within that county. I’d like it set 
   up like this.
    ………………………….. Select a State [drop down menu]
 * Select a County
    [drop down menu]
 * Select a City
    [drop down menu]
 * …………………………….
 * Suggestions on how to construct?

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

 *  Plugin Author [Jules Colle](https://wordpress.org/support/users/jules-colle/)
 * (@jules-colle)
 * [9 years ago](https://wordpress.org/support/topic/conditional-drop-down-2/#post-9074164)
 * you will need to construct a dropdown list with all the different states first.
   then per state you need a seperate group, each one containing a drop down list
   with all the different counties and an additional nested group for each of the
   counties within the state, and then, per county group add a dropdown list with
   all the possible cities.
 * it’s gonna get quit complex and have a lot of nested groups going on, but if 
   you are a bit handy with a find and replace text editor using regex (notepad+
   + or editpad pro) you can easily generate the form code from an excel file.
 * here’s a small example to get you on your way:
 *     ```
       [select state "state1" "state2"]
       [group state1]
         [select state1county "state1county1" "state1county2"]
         [group state1county1]
           [select state1county1city "state1county1city1" "state1county1city2"]
         [/group]
         [group state1county2]
           [select state1county2city "state2county2city1" "state1county2city2"]
         [/group]
       [/group]
       [group state2]
         [select state2county "state2county1" "state2county2"]
         [group state2county1]
           [select state2county1city "state1county1city1" "state2county1city2"]
         [/group]
         [group state2county2]
           [select state2county2city "state2county1city1" "state2county2city1"]
         [/group]
       [/group]
       ```
   
 * i figure the conditions would be self explanatory, but here are a couple to get
   you on your way
 *     ```
       if [state] equals "state1" then show [state1]
       if [state1county] equals "state1county1" then show [state1county1]
       if [state1county1city] equals "state1county1city1" then show [state1county1city1]
       ```
   
 *  Thread Starter [somethingelse3](https://wordpress.org/support/users/somethingelse3/)
 * (@somethingelse3)
 * [9 years ago](https://wordpress.org/support/topic/conditional-drop-down-2/#post-9075358)
 * thank you!

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

The topic ‘Conditional Drop Down’ is closed to new replies.

 * ![](https://ps.w.org/cf7-conditional-fields/assets/icon-256x256.png?rev=2072595)
 * [Conditional Fields for Contact Form 7](https://wordpress.org/plugins/cf7-conditional-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cf7-conditional-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cf7-conditional-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cf7-conditional-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cf7-conditional-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [somethingelse3](https://wordpress.org/support/users/somethingelse3/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/conditional-drop-down-2/#post-9075358)
 * Status: resolved