Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Location Selection (Using ID #'s)

Status
Not open for further replies.

FastJimmy

Programmer
Jun 15, 2000
23
US
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
 
hi Jimmy

Can you give us just one piece to think about? It sounds like you have a lot of decisions to make, but have you ever created a form that updates multiple fields in a table?

This sounds like what you want, and Id avoid complex HTML or DHTML tasks until you get the basics working.

Again, do you have a smaller task you have a question about? Tell us what you need to do and how you envision the site drill down (click here, click there) working.
 
You can do it in two way.
1. (simple)You can write the javascript to reload function on select box onchange event.

2. If you do not want to the page to be refreshed use the wddx functions.Using cfwddx tag you need to conver the country, State, City queries to javascript recordset object.
 
I've had quite a bit of experience with cold fusion, enough to get around in it. I've created forms that update multiple fields in a table.

The question I asked about the database yesterday was an important one. This is one that I have been wondering about for awhile and had some free time between classes so I posted it.

Thanks ram123, I'll read up about the cfwddx tag and see if I can figure that out.

Jimmy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top