Home  >  Article  >  Backend Development  >  Multi-level linkage drop-down selection box to dynamically obtain the next level

Multi-level linkage drop-down selection box to dynamically obtain the next level

黄舟
黄舟Original
2017-03-02 17:29:311788browse

Multi-level linkage drop-down selection box, dynamically obtain the next level, each level of data is xml, can support unlimited levels (the browser needs Microsoft.XMLDOM support)

Project needs, a material category table , Level 3, with a total of more than 7,000 records, which would be very slow if retrieved at one time, so dynamic reading was used to read one level at a time, and the server used caching, which was very efficient.

The HTML code is as follows:

<select name="MaterialClass1" ChildSelectName="MaterialClass2"></select>
<select name="MaterialClass2" ChildSelectName="MaterialClass3"></select>
<select name="MaterialClass3"></select> 
&#39;www.knowsky.com
其中ChildSelectName表示下一级Select的name

One of the xmls is as follows:

<MaterialClasses>
<MaterialClass MaterialClassCode="01" Description="黑色及有色金属"/>
<MaterialClass MaterialClassCode="02" Description="水泥、砂石砖瓦、砼"/>
<MaterialClass MaterialClassCode="03" Description="木、竹材及其制品"/>
</MaterialClasses>

The above is a multi-level linkage drop-down selection box, which dynamically obtains the content of the next level, more related Please pay attention to the PHP Chinese website (www.php.cn) for content!


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