 |
|
จะต่อยังไงดีอ่าครับ ช่วยแนะนำหน่อยน่ะครับ 
<script language="javascript" type="text/javascript">
<!--
function listboxchange1(p_index) {
//Clear Current options in subcategory1
document.form1.subcategory1.options.length = 0;
//Clear Current options in subcategory2
document.form1.subcategory2.options.length = 0;
document.form1.subcategory2.options[0] = new Option("Select Items", "");
switch (p_index) {
case "Product1":
document.form1.subcategory1.options[0] = new Option("Select Brands", "");
document.form1.subcategory1.options[1] = new Option("Brand1", "Brand1");
document.form1.subcategory1.options[2] = new Option("Brand2", "Brand2");
break;
case "Product2":
document.form1.subcategory1.options[0] = new Option("Select Brands", "");
document.form1.subcategory1.options[1] = new Option("Brand1", "Brand1");
document.form1.subcategory1.options[2] = new Option("Brand2", "Brand2");
break;
case "Product3":
document.form1.subcategory1.options[0] = new Option("Select Brands", "");
document.form1.subcategory1.options[1] = new Option("Brand1", "Brand1");
document.form1.subcategory1.options[2] = new Option("Brand2", "Brand2");
break;
case "Product4":
document.form1.subcategory1.options[0] = new Option("Select Brands", "");
document.form1.subcategory1.options[1] = new Option("Brand1", "Brand1");
document.form1.subcategory1.options[2] = new Option("Brand2", "Brand2");
break;
}
return true;
}
//-->
</script>
<script language="javascript" type="text/javascript">
<!--
function listboxchange(p_index) {
//Clear Current options in subcategory
document.form1.subcategory2.options.length = 0;
switch (p_index) {
case "Brand1":
document.form1.subcategory2.options[0] = new Option("Select Items", "");
document.form1.subcategory2.options[1] = new Option("Item1", "Item1");
document.form1.subcategory2.options[2] = new Option("Item2", "Item2");
document.form1.subcategory2.options[3] = new Option("Item3", "Item3");
break;
case "Brand2":
document.form1.subcategory2.options[0] = new Option("Select Items", "");
document.form1.subcategory2.options[1] = new Option("Item1", "Item1");
document.form1.subcategory2.options[2] = new Option("Item2", "Item2");
break;
}
return true;
}
//-->
</script>
Tag : HTML/CSS, JavaScript
|
|
 |
 |
 |
 |
Date :
2012-02-25 15:52:20 |
By :
ผู้ด้อยความรู้ |
View :
1794 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |