// Second-level association Description: the value of the select statement must match the value of allinfo. The array format of all second-level values is value | text // Jia Shiyi www.2cto. comfunctionselectChange (obj, changeId, allinfo) {varselValueobj. options [obj. selec...
// Second-level interaction Description: the value of the select statement must match the value of allinfo. The array format of all values of the second-level interaction is value | text
// Jia Shiyi
Www.2cto.com
Function selectChange (obj, changeId, allinfo ){
Var selValue = obj. options [obj. selectedIndex]. value; // obtain the selected value in the select object.
Var objChange = document. getElementById (changeId );
If (objChange ){
ObjChange. options. length = 0;
For (I = 0; I <allinfo. length; I ++ ){
If (allinfo [I]. substring (0, selValue. length) = selValue ){
ObjChange. options. length ++;
Var p = allinfo [I]. indexOf ("| ");
Var text = allinfo [I]. substr (p + 1 );
Var value = allinfo [I]. substr (0, p );
ObjChange. options [objChange. options. length-1] = new Option (text, value );
}
}
}
}