I am in the process of creating a program in which addresses are stored. The city, state and country for each address are stored in the database and are defined by a: cityID, stateID and countryID.
Right now, the way I do this is to pop open a seperate window then were the address is filled in with a link ("select location here". This pop-up window is merely a form that dynamically populates.
The user first selects the country and submits, then the states/provinces from that country come up. The user then select the state/province from that list and the cities located within it are populated into a drop down menu. Last the user selects the city, After everything is selected it sets session variables for the country, state and city chosen based on their ID #'s. the location is displayed to verify it's right.If no is clicked the process starts over, if yes is clicked the window is closed.This information will not go into the database until the rest of the address information is selected. After the address is submitted to the database and those session variables set for location are then cleared.
I was wondering if anyone knows of a way to do this all on the same page as the rest of the address information so that when a country is selected from a drop down menu a drop down menu below it will dynamically populate with the information about the states/provinces from that country (then the same with cities in the state/province will happen.) I was thinking about using DHTML or Javascript somehow, but am not sure. I have racked my brain trying to figure this out without using a pop-up window but have been unable to come up with a way so far.Any help on this subject would be VERY appreciated!!
Thank you!
Jimmy
Right now, the way I do this is to pop open a seperate window then were the address is filled in with a link ("select location here". This pop-up window is merely a form that dynamically populates.
The user first selects the country and submits, then the states/provinces from that country come up. The user then select the state/province from that list and the cities located within it are populated into a drop down menu. Last the user selects the city, After everything is selected it sets session variables for the country, state and city chosen based on their ID #'s. the location is displayed to verify it's right.If no is clicked the process starts over, if yes is clicked the window is closed.This information will not go into the database until the rest of the address information is selected. After the address is submitted to the database and those session variables set for location are then cleared.
I was wondering if anyone knows of a way to do this all on the same page as the rest of the address information so that when a country is selected from a drop down menu a drop down menu below it will dynamically populate with the information about the states/provinces from that country (then the same with cities in the state/province will happen.) I was thinking about using DHTML or Javascript somehow, but am not sure. I have racked my brain trying to figure this out without using a pop-up window but have been unable to come up with a way so far.Any help on this subject would be VERY appreciated!!
Thank you!
Jimmy