Dependent Dropdown Example

This tutorial will show you how to create dependent or cascaded dynamic dropdown using jQuery. Sometimes we need to create such a cascaded dropdown where we need to select some value in the second dropdown based on first dropdown value. For example, we need to select city dropdown value based on country dropdown value and for this we cannot pre-populate the city dropdown value unless we know the country from country dropdown.

I will explain here with an example using jQuery. The example here contains two dropdown – one is parent dropdown that contains Continents & Oceans and another is sub-dropdown that contains continets names & oceans names and will be displayed based on selected parent dropdown value. Continue reading “Dependent Dropdown Example”

Dependent dropdown example in PHP, MySQL

This tutorial shows how to create dependent dropdown in PHP and MYSQL. This is also called cascaded dropdown. This tutorial uses JavaScript to submit the form automatically when the first dropdown value is selected.

Sometimes we need to create such a cascaded dropdown when we need to select some value in the second dropdown based on first dropdown value or third dropdown value based on second dropdown value.

For example, we need to select city dropdown value based on country dropdown value and for this we cannot pre-populate the city dropdown value unless we know the country from country dropdown. Continue reading “Dependent dropdown example in PHP, MySQL”