function GetSubDropdown(parameterVal){ cascadeDropdownObj.empty();//Initially clear the subordinate list cascadeDropdownObj.append("");//Add a (None) value var camlQuery = " < ;Where> " parameterVal " < /Eq>
"; $().SPServices({ operation: "GetListItems", async: false, listName: "CascadeSub", CAMLQuery: camlQuery, completefunc: function (xData, Status) { $(xData.responseXML).find("[nodeName=z:row]").each( function() { var subDropdownVal = $(this).attr("ows_SubDropdownVal");//Get the value corresponding to the word table //binding subDropdown cascadeDropdownObj.append(""); }); } }); } //cascading 'Dropdown' dropdownObj.change(function(){ var dropdownSelectTextObj = $("select[title$='Dropdown'] option:selected");//Get the current selected value switch(dropdownSelectTextObj.text()){ case "L1": GetSubDropdown("L1"); break; case "L2": GetSubDropdown("L2"); break; case "PL1": GetSubDropdown ("PL1"); break; default: //Indicates that after selecting the (None) value, the lower-level list is initially cleared cascadeDropdownObj.empty(); cascadeDropdownObj.append("< ;option selected='selected'>(None)"); break; } });
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn