I added a button to the ribbon toolbar button in my extension to Tridion CMS. When you click on the button, a pop-up page appears with two drop-down lists. By changing the values ββin the first control drop, I have to fill in the values ββfor the second control of the drop-down list. In my case, I am using an ASP drop down list
control. Currently, I will hard code the values ββto be populated in the second drop-down list in the java script. For this requirement, I use the following code, but I cannot fill in the value (Do not identify the tag).
Java script code:
ABC.WCMS.RTFExtension.Popups.ButtonPopup.prototype._populate = function () { var selectedValue = $('#functionalcomponent').value;//First dropdown selected value var dropdownId = $("#Dd");//Second Dropdown Control switch (selectedValue) { case "Home Ware": dropdownId.append($("<option> </option>").val("Select Sub-Category").html("")); dropdownId.append($("<option> </option>").val("Air-Conditioners/Coolers").html("Air-Conditioners/Coolers")); break; case "Education": dropdownId.append($("<option> </option>").val("Select Sub-Category").html("")); dropdownId.append($("<option> </option>").val("Colleges").html("Colleges")); break; default: dropdownId.append($("<option> </option>").val("Select Sub-Category").html("")); dropdownId.append($("<option> </option>").val("No Value").html("No Value")); } return true; }
ASPX controls:
<%--Dropdown1--%> <asp:DropDownList ID="functionalcomponent" runat="server"></asp:DropDownList> <%--Dropdown2--%> <asp:DropDownList ID="Dd" runat="server"></asp:DropDownList>
How can I fill in the values ββfor the second dropdown from an external JavaScript file?
source share