This topic is locked

Select Country... then State or Prov...

5/7/2008 12:53:07 PM
PHPRunner General questions
M
michaelmac author

hey everyone
As everyone knows, PHPR 4.x RULES!!!
Here is my question:
We have a add/edit page that has a country selector from a table called countries...
Table One: Country... it had Japan-JPN, USA-USA, China-CHN, France-FRN and others

Table Two: Country and State/Prov.. like USA-Alabama, USA-Alaska,CAN-Quebec,CAN-British Columbia.. etc,etc...
I have two drop downs.. I know I can pull from one table, but I am using two.. but what I want to know is how do I pass the "filter" to the next drop-down
What I want to do is if "USA" is selected in my country drop-down, then when I select my states in my State/Prov drop-down, have my where filter apply "USA". If I chose "CAN" as my country, set my State/Prov drop down filter to "CAN". I know I am on the right track, I just am not sure where to modify the code at.
As always
Thanks
Mike

J
Jane 5/8/2008

Mike,
use dependent dropdown boxes for this purpose.

Check off This dropdown is dependent on option for the second dropdown and select country in Category control and Category field dropdowns on the "Edit as" settings dialog on the Visual Editor tab.
Also I recommend you to have a look at the "How to setup dependent dropdown boxes on Edit/Add pages" PHPRunner tutorial:

http://www.xlinesoft.com/phprunner/php-database.htm