Two-Level Linkage menu detailed

Source: Internet
Author: User
Menu | Linkage Menu | detailed <html>


<head>


</head>


<body>


<script language= "JavaScript" >


<!--


var subcat = new Array ();


subcat[0] = new Array (' 10 ', ' 1 ', ' = 1 ')


subcat[1] = new Array (' 10 ', ' 2 ', ' = 2 ')


subcat[2] = new Array (' 10 ', ' 3 ', ' = 3 ')


subcat[3] = new Array (' 10 ', ' 4 ', ' = 4 ')


subcat[4] = new Array (' 10 ', ' 5 ', ' = 5 ')


subcat[5] = new Array (' 10 ', ' 6 ', ' = 6 ')


subcat[6] = new Array (' 10 ', ' 7 ', ' = 7 ')


subcat[7] = new Array (' 10 ', ' 8 ', ' = 8 ')


subcat[8] = new Array (' 10 ', ' 9 ', ' = 9 ')


subcat[9] = new Array (' 10 ', ' 10 ', ' = 10 ')


subcat[10] = new Array (' 20 ', ' 11 ', ' = 11 ')


subcat[11] = new Array (' 20 ', ' 12 ', ' = 12 ')


subcat[12] = new Array (' 20 ', ' 13 ', ' = 13 ')


subcat[13] = new Array (' 20 ', ' 14 ', ' = 14 ')


SUBCAT[14] = new Array (' 20 ', ' 15 ', ' = 15 ')


subcat[15] = new Array (' 20 ', ' 16 ', ' = 16 ')


subcat[16] = new Array (' 20 ', ' 17 ', ' = 17 ')


subcat[17] = new Array (' 20 ', ' 18 ', ' = 18 ')


subcat[18] = new Array (' 20 ', ' 19 ', ' = 19 ')


subcat[19] = new Array (' 20 ', ' 20 ', ' = 20 ')


function Changeselect1 (LocationID)


{


document.form1.s2.length = 0; Initialize the Drop-down list to clear the Drop-down data


Document.form1.s2.options[0] = new Option (' = = Please select = = ', '); Give the first value


for (i=0 i<subcat.length; i++)//legth=20


{


if (subcat[i][0] = = LocationID)//[0] [1] The first column is the second column


{Document.form1.s2.options[document.form1.s2.length] = new Option (subcat[i][1], subcat[i][2]); Set option


//The first time length=1 because have = = Please choose = =


//i=9 when length= 10 value has 11 because from 0 subcat[i][0] = = LocationID Mask and write


}


}


//-->


</script>





<form name= "Form1" >


Two-level linkage:





<select name= "S1" onchange= "Changeselect1 (this.value)" >


<option>== Please select ==</option>


<option value= "Ten" >1-10</option>


<option value= ">11-20</option>
"

</select>





<select name= "S2" onchange= "alert (this.value)" >


<option>== Please select ==</option>


</select>





</form>














Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.