Hello,
I've created an example for you.
Create 2 select lists. The first should be named "country" and the second "city". The first has values:
1;Select Country;none
0;USA;usa
0;Germany;germany
The second list has only "0" inserted.
Now go to the "country" element > Advanced tab > Actionscript > Type > Custom > Actions > Change and use this code in the framework:
function ff_country_action(element, action)
{
var city = ff_getElementByName('city');
var usaArray = new Array(
'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix', 'Philadelphia',
'San Antonio', 'San Diego', 'Dallas', 'San Jose', 'Austin', 'Denver',
'Las Vegas', 'Seattle', 'Miami', 'Washington', 'Sacramento', 'Other'
);
var germanyArray = new Array(
'Berlin', 'Frankfurt', 'München', 'Köln', 'Frankfurt am Main', 'Stuttgart',
'Düsseldorf', 'Dortmund', 'Essen', 'Leipzig', 'Bremen', 'Other'
);
if (element.value == 'none') {
// drop cities
while (city.options.length > 0)
city.options[city.options.length-1] = null;
} else {
// get the matching array
var selectedArray = eval(element.value+'Array');
// drop supernumerous option
while (selectedArray.length < city.options.length-1)
city.options[city.options.length-1] = null;
// add the new options
city.options[0] = new Option('Select City', 'none', true, true);
for (var i=0; i < selectedArray.length; i++)
city.options[i+1] =
new Option(selectedArray[i], selectedArray[i]);
}
}
Simply add more cities in the arrays between single quotes.
I will attach you the form. Install it and test it out.
Regards,
Marko
======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on
Facebook!