PDA

View Full Version : drop down combo update how?


nanny
11-22-2007, 12:34 AM
Hi I am successfully doing the drop down combo on insert but to edit it is a pain. I can't seem to get it to work. Yes it will show the users input but if I have say country and state there are a lot of states to choose from they all show up.
Any suggestions?

davidj
11-22-2007, 09:05 AM
if doropdown 1 contains the country then the value which is passed is the state ID

the query which populates dropdown2 uses the state ID to return a result

example..

if you choose country 1 you pass in the id which looks in the state table and returns everything with an id of 10 which in this example gives you 4 states to populate in your second dropdown

////////////////////////////////

country 1 > id = 10
country 2 > id = 11
country 3 > id = 12

////////////////////////////////

state 1 > id = 10
state 2 > id = 10
state 3 > id = 10
state 4 > id = 10

state 5 > id = 11
state 6 > id = 11
state 7 > id = 11

state 8 > id = 12
state 9 > id = 12
state 10 > id = 12
state 11 > id = 12
state 12 > id = 12
state 13 > id = 12
////////////////////////////////