I added a button to the ribbon toolbar button in my extension to the Tridion CMS. On click of the button a popup page will display with two drop downs. By changing the values in the first drop down control I should populate the values for second drop down control. In my case I am using ASP drop down list
control. For the time being I will hard code the values to be populated to the second drop down in java script. For this requirement I am using the following code but I am not able to populate the value (Not Identifying 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 populate the values for second drop down from external JavaScript file?