Dependent Dropdown Lists

Results 1 to 2 of 2

Thread: Dependent Dropdown Lists

  1. #1
    Join Date
    Dec 1969

    Default Dependent Dropdown Lists

    I&#039;m trying to write a page which will contain three dropdown lists, all of which will be populated by the same table in an Access database. The first list will contain ZIP codes, the second Cities,and the third states. The user will be able to select values from the lists in any order.<BR><BR>My problem is that the items chosen on any particular list have to update the items in the other lists. For example, if the user chooses "Georgia" from the state list, I want the other two lists populated with Georgia cities and Georgia ZIP codes. If the user picks Dallas in the city list and Texas in the state list, I want the ZIP list populated only with those ZIPs located in Dallas, TX.<BR><BR>The end result of all this will be that the user will be able to choose a street name from yet another list (populated from the same table and based on the values in the other three lists).<BR><BR>I have no problem populating the lists with database information, but how the heck do I make them repopulate based on the selections in the other lists? Help would be very much appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: Dependent Dropdown Lists

    There are a number of ways to do this and most of them involve heavy processing, due mainly to the number of cities and zip codes there are.<BR><BR>If it&#039;s not a problem resubmitting the page, you could add an onchange() event to the state and city drop down lists that resubmits the page and populates the other lists with the relevant info. That&#039;s the easiest way, but the user would either lose any other information they&#039;ve entered on the page or you&#039;d have to grab them during the submit and repopulate all the fields.<BR><BR>The only other way I can think of is to put all the info into javascript arrays and filter through those on the onchange() event, but that would cause the page to take a long time to load and hang up everytime they made a selection. You&#039;re better off resubmitting and grabbing everything from the database when they make a selection

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts