How to Fill Dropdown with Non Ajax

In This simple PHP tutorial, I will let you know how to fill dropdown with non ajax manner. Normally we are refreshing dropdown based on selected master dropdown value, i.e we are using country and states two dropdown and based on country selected we will fill state dropdown. There are two method one is – we can fire a Ajax request based on selected country and other is we can set state using json object without ajax round-trip. This can improve your website response time. Here we will learn that.

dropdown-non-ajax

Also Checkout other Dropdown jQuery tutorial,

Below are simple steps to filled dropdown values with non ajax manner:

Steps 1: We will get all necessary data from both dropdown based on our requirement.
Steps 2: We will convert that array into json object.

Steps 3: We will create HTML Layout.

Steps 4: We will iterate on json object and append to state dropdown list.

Live Demo and Download Source Code