php dynamic combo boxes
The problem that i have is as below:
On a php webpage, i have two combo drop down boxes. One is for State and another is for region. The State combo box has the following 5 values:
Virginia
California
Florida
NewYork
Kansas
The region combo box has the following 5 values:
East
West
North
South
Others
The relation between the two combo boxes is as below:
Virginia - East
California - West
Florida - South
NewYork - North
Kansas - Others
Now when the php page loads the first time assume that the selected value displayed in the combo box 1 is Florida whose region combo box has a value South.
Now when the user selects Kansas as the State in the 1st combo box i shud be able to display Others in the region combo box. Also i shud be able to display a blank text box adjacent to this regiion combo box where user can enter some value (eg: mid west, mid east....any value.).
Again lets say the user now selects California in the 1st combo box, this time we shud display West as the value in the 2nd combo box and shud hide the text box that was displayed for Others during the previous selection.
All this shud be dynamic without any hard coding. You can hardcode the state and region value only for the 1st display when the page loads for the first time. All others will be dynamic.
Please send me the source code for this asap.
Thanks in Advance
|