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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent Child relation in dropdown´s

Status
Not open for further replies.

19691712

IS-IT--Management
Joined
Sep 2, 2001
Messages
1
Location
DE
I have to create 4 dropdown´s in a form which are related to each other. The data comes from 4 different tabels of an Access database via 4 different queries (including an ID to the next table).
The output should be as follows:
1.dropdown = states of Austria
2.dropdown = districts of the preselected state
3.dropdown = cities of the preselected state and district
4.dropdown = zipcodes of the preselected .....
I found one solution with javascript but due to the fact that Austria got 19.000! different zipcodes the output is by far too slow.

Hope some of you can come up with a better solution. Thanks in advance Peter.
 
Hi,

Maybe you can use the onchange="submit(this.form)" event and let each of your drop downs submit to the original page. Then you can use
<cfif IsDefined('form.dropdown_1')>
<cfquery name=&quot;qDistricts&quot;>
select * from districts where state = '#form.dropdown_1#'
</cfquery>
</cfif>

and now

<select name=&quot;district&quot; onchange=&quot;submit(this.form)&quot;>
<cfoutput query=&quot;qDistricts&quot;>
<option>
#district#
</option>
</cfoutput>
</select>


and so on
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top