Yes and yes. The attached enables the selection of a football league which populates the second drop-down of teams.
The scripting requirements are not trivial, particularly when you introduce a third dependent drop-down. Consider the script object used to perform the above...
// form1.#variables[0].myScriptObject - (JavaScript, client)
var epl = "Arsenal,Chelsea,Manchester United,Tottenham";
var liga = "Barcelona,Real Madrid,Valencia,Mallorca";
var seriea = "Roma,Inter Milan,AC Milan,Sampdoria";
var eplArray = new Array();
eplArray = epl.split(",");
var ligaArray = new Array();
ligaArray = liga.split(",");
var serieaArray = new Array();
serieaArray = seriea.split(",");
function loadData(dropdownField) {
if (!(form1.page1.subform1.league.isNull)) {
switch (form1.page1.subform1.league.rawValue) {
case "English Premier League":
for (var i=0; i < eplArray.length; i++) {
dropdownField.addItem(eplArray[i]);
}
break;
case "Spanish Liga":
for (var i=0; i < ligaArray.length; i++) {
dropdownField.addItem(ligaArray[i]);
}
break;
case "Italian Serie A":
for (var i=0; i < serieaArray.length; i++) {
dropdownField.addItem(serieaArray[i]);
}
break;
default:
break;
}
}
}
This can be accomplished using multi-dimensional arrays also but I find the approach above simpler.
Steve