I have a form with the country drop down list which has all the countries..if I select one country I need to populate the respective states of the country...can any one help me how to do it using jquery html php??
There are a number of ways this can be done. One way is to place all the states on the page in DIVs but hidden. When you select the country the use the val() of that entry to get the country name. This can then be used as the ID of the div that has the states for that country for issuing an unhide(). Another is to pass the country name in an AJAX call which returns the HTML for that list of states. The former will work if the number of countries is small (otherwise the page gets very large and takes time to load). The second scales better with a larger number of countries since the page is small and the states are added when needed.