Forums
This topic is locked
Help with linking drop down menus
Posted 22 years ago
1
has voted
22 years ago Remie Belmonte posted:
can anybody help me with linking 2 drop down menus. I have one drop down menu selecting a city and then the other drop down menu let's you select the district from the city you've selected from the first drop down menu Replies
Replied 22 years ago
22 years ago Brent Colflesh replied:
Dear Remie,
Here is a Javascript example:
www.codetoad.com/javascript/navigation/conditional_menus.asp
Regards,
Brent
Here is a Javascript example:
www.codetoad.com/javascript/navigation/conditional_menus.asp
Regards,
Brent
Replied 22 years ago
22 years ago Derran Williams replied:
im trying to do a similar thing but using fields in a database as my names/values any one esle got any ideas?
cheers
des
cheers
des
Replied 22 years ago
22 years ago Dennis van Galen replied:
I always use this:
www.macromedia.com/support/ultradev/ts/documents/client_dynamic_listbox.htm
with regards,
Dennis van Galen
DMXzone Manager
dennis@dmxzone.com
Extension, Tutorial and FAQ's Manager
www.macromedia.com/support/ultradev/ts/documents/client_dynamic_listbox.htm
with regards,
Dennis van Galen
DMXzone Manager
dennis@dmxzone.com
Extension, Tutorial and FAQ's Manager
Replied 13 years ago
13 years ago Chris Trace replied:
I have done all this and still wont work
any help
<script >
var arrDynaList = new Array(); var arrDL1 = new Array(); arrDL1[1] = "addmuofficeid"; // Name of parent list box
arrDL1[2] = "newcase";// Name of form containing parent list box
arrDL1[3] = "addmusuid";// Name of child list box
arrDL1[4] = "newcase";// Name of form containing child list box
arrDL1[5] = arrDynaList;<% var txtDynaListRelation, txtDynaListLabel, txtDynaListValue, oDynaListRS; txtDynaListRelation = "muofficeid"// Name of recordset field relating to parent
txtDynaListLabel = "musufirstname"// Name of recordset field for child Item Label
txtDynaListValue = "musuid"// Name of recordset field for child Value
oDynaListRS = subuserlist// Name of child list box recordset
var varDynaList = -1; var varMaxWidth = "1"; var varCheckGroup = oDynaListRS.Fields.Item(txtDynaListRelation).Value; var varCheckLength = 0; var varMaxLength = 0; while (!oDynaListRS.EOF){ if (varCheckGroup != oDynaListRS.Fields.Item(txtDynaListRelation).Value) { varMaxLength = Math.max(varCheckLength, varMaxLength) varCheckLength = 0; } %> arrDynaList[<%=(varDynaList+1)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListRelation).Value)%>"; arrDynaList[<%=(varDynaList+2)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListLabel).Value)%>"; arrDynaList[<%=(varDynaList+3)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListValue).Value)%>";<% if (oDynaListRS.Fields.Item(txtDynaListLabel).Value.length > varMaxWidth.length) { varMaxWidth = oDynaListRS.Fields.Item(txtDynaListLabel).Value; } varCheckLength = varCheckLength + 1; varDynaList = varDynaList + 3; oDynaListRS.MoveNext(); } varMaxLength = Math.max(varCheckLength, varMaxLength) %>
</script>
<!-- End of object/array definitions, beginning of generic functions -->
<script >
function setDynaList(arrDL){ var oList1 = document.forms[arrDL[2]].elements[arrDL[1]] var oList2 = document.forms[arrDL[4]].elements[arrDL[3]] var arrList = arrDL[5] clearDynaList(oList2); if (oList1.selectedIndex == -1){ oList1.selectedIndex = 0; } populateDynaList(oList2, oList1[oList1.selectedIndex].value, arrList); return true; } function clearDynaList(oList){ for (var i = oList.options.length; i >= 0; i--){ oList.options[i] = null; } oList.selectedIndex = -1; } function populateDynaList(oList, nIndex, aArray){ for (var i = 0; i < aArray.length; i= i + 3){ if (aArray[i] == nIndex){ oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]); } } if (oList.options.length == 0){ oList.options[oList.options.length] = new Option("[none available]",0); } oList.selectedIndex = 0; }
</script>
any help
<script >
var arrDynaList = new Array(); var arrDL1 = new Array(); arrDL1[1] = "addmuofficeid"; // Name of parent list box
arrDL1[2] = "newcase";// Name of form containing parent list box
arrDL1[3] = "addmusuid";// Name of child list box
arrDL1[4] = "newcase";// Name of form containing child list box
arrDL1[5] = arrDynaList;<% var txtDynaListRelation, txtDynaListLabel, txtDynaListValue, oDynaListRS; txtDynaListRelation = "muofficeid"// Name of recordset field relating to parent
txtDynaListLabel = "musufirstname"// Name of recordset field for child Item Label
txtDynaListValue = "musuid"// Name of recordset field for child Value
oDynaListRS = subuserlist// Name of child list box recordset
var varDynaList = -1; var varMaxWidth = "1"; var varCheckGroup = oDynaListRS.Fields.Item(txtDynaListRelation).Value; var varCheckLength = 0; var varMaxLength = 0; while (!oDynaListRS.EOF){ if (varCheckGroup != oDynaListRS.Fields.Item(txtDynaListRelation).Value) { varMaxLength = Math.max(varCheckLength, varMaxLength) varCheckLength = 0; } %> arrDynaList[<%=(varDynaList+1)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListRelation).Value)%>"; arrDynaList[<%=(varDynaList+2)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListLabel).Value)%>"; arrDynaList[<%=(varDynaList+3)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListValue).Value)%>";<% if (oDynaListRS.Fields.Item(txtDynaListLabel).Value.length > varMaxWidth.length) { varMaxWidth = oDynaListRS.Fields.Item(txtDynaListLabel).Value; } varCheckLength = varCheckLength + 1; varDynaList = varDynaList + 3; oDynaListRS.MoveNext(); } varMaxLength = Math.max(varCheckLength, varMaxLength) %>
</script>
<!-- End of object/array definitions, beginning of generic functions -->
<script >
function setDynaList(arrDL){ var oList1 = document.forms[arrDL[2]].elements[arrDL[1]] var oList2 = document.forms[arrDL[4]].elements[arrDL[3]] var arrList = arrDL[5] clearDynaList(oList2); if (oList1.selectedIndex == -1){ oList1.selectedIndex = 0; } populateDynaList(oList2, oList1[oList1.selectedIndex].value, arrList); return true; } function clearDynaList(oList){ for (var i = oList.options.length; i >= 0; i--){ oList.options[i] = null; } oList.selectedIndex = -1; } function populateDynaList(oList, nIndex, aArray){ for (var i = 0; i < aArray.length; i= i + 3){ if (aArray[i] == nIndex){ oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]); } } if (oList.options.length == 0){ oList.options[oList.options.length] = new Option("[none available]",0); } oList.selectedIndex = 0; }
</script>
Replied 12 years ago
12 years ago maria streeting replied:
I came upon a few blogs who had drop down menus as their navigation but instead of having a box they could click on, it was a picture of, for example, a little cat.
Click here to obtain more information Raspberry Ketone Supplement
Click here to obtain more information Raspberry Ketone Supplement