Title: Cascading dropdown fields
Last modified: March 6, 2021

---

# Cascading dropdown fields

 *  [rladha](https://wordpress.org/support/users/rladha/)
 * (@rladha)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cascading-dropdown-fields/)
 * Example: Two drop down fields: Country and State/Province. I would like to display
   list of Provinces based on the selection of the Country field.
 * USA –> California, New York, Texas etc
    Canada –> Ontario, Quebec, etc
 * I will really appreciate your feedback!
 * thanks
 * Rahim

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

 *  [charles godwin](https://wordpress.org/support/users/charlesgodwin/)
 * (@charlesgodwin)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cascading-dropdown-fields/#post-14144507)
 * Have you tested this? I’ll say I haven’t but I expect that if I selected Canada
   I think the only choices in the state/province column would be provinces, barring
   any coding errors in the data. I believe the drop downs are dynamically generated
   from the data in the table.
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cascading-dropdown-fields/#post-14145435)
 * Hi Guys,
 * Interesting topic!
 * You need to add some javascript that handles the onchange event of those listboxes.
   If you want to fill these listboxes with hard coded values, you can just use 
   plain javascript which can be added to your page with the Code Manager.
 * If you want to use the values in your database, it is less simple. In that case
   you need to write a (probably JSON) service that performs your query and handle
   the result with javascript. You will need to use either one of the action hooks
   mentioned below to add your logic:
    wpda_before_simple_form wpda_after_simple_form
 * Does this help (a little)? 🙂
    Peter
 *  Thread Starter [rladha](https://wordpress.org/support/users/rladha/)
 * (@rladha)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cascading-dropdown-fields/#post-14146541)
 * Thanks, [@peterschulznl](https://wordpress.org/support/users/peterschulznl/) 
   and [@charlesgodwin](https://wordpress.org/support/users/charlesgodwin/)
 * [@peterschulznl](https://wordpress.org/support/users/peterschulznl/) – I believe,
   Javascript is the approach because the record is still not saved!
 * If you can share a sample or example – I willing to give it a try.
 * thanks again — love this plug-in!!
 * Rahim
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/cascading-dropdown-fields/#post-14148626)
 * Hi Rahim,
 * Is there a public URL we can visit to see your page? Or can you send me some 
   screenshots?
 * Thanks,
    Peter

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

The topic ‘Cascading dropdown fields’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/cascading-dropdown-fields/#post-14148626)
 * Status: not resolved