1
var
otype
=
crmForm.all.nav_type1;
2 var otype1 = crmForm.all.nav_type2;
3
4 var type1Array = new Array( " 投诉1 " , " 投诉2 " );
5 // 初始化信息子类别
6 otype1.options.length = 0 ;
7 for ( var i = 0 ;i < type1Array.length;i ++ ){
8 var y = document.createElement( ' option ' );
9 y.text = type1Array[i];
10 y.value = i + 1 ;
11 otype1.options.add(y);
12 }
13 // 信息类别id 为2
14 if (otype.options[otype.selectedIndex].value == 2 )
15 {
16 for ( var j = 0 ; j < otype1.options.length; j ++ )
17 {
18 // 信息子类别id 不等于1
19 if (otype1.options[j].value != 1 )
20 otype1.options.remove(j); // 移除不等于1的值
21 }
22 }
2 var otype1 = crmForm.all.nav_type2;
3
4 var type1Array = new Array( " 投诉1 " , " 投诉2 " );
5 // 初始化信息子类别
6 otype1.options.length = 0 ;
7 for ( var i = 0 ;i < type1Array.length;i ++ ){
8 var y = document.createElement( ' option ' );
9 y.text = type1Array[i];
10 y.value = i + 1 ;
11 otype1.options.add(y);
12 }
13 // 信息类别id 为2
14 if (otype.options[otype.selectedIndex].value == 2 )
15 {
16 for ( var j = 0 ; j < otype1.options.length; j ++ )
17 {
18 // 信息子类别id 不等于1
19 if (otype1.options[j].value != 1 )
20 otype1.options.remove(j); // 移除不等于1的值
21 }
22 }
请参看:戈雅论坛