try:function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
  var myEle ;
  var x ;
  // Empty the second drop down box of any choices
 for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
 // ADD Default Choice - in case there are no values
  myEle = document.createElement("option") ;
  myEle.value = "" ;
  myEle.text = "[选 择]" ;
  controlToPopulate.add(myEle) ;
bool bAdd = false;
for ( x = 0 ; x < ItemArray.length  ; x++ )
    {
     if ( GroupArray[x] == control.value )
       {
     bAdd = true;
         myEle = document.createElement("option") ;
          myEle.value =x ;
         myEle.text = ItemArray[x] ;
          controlToPopulate.add(myEle) ;
        }
    }if( !bAdd )
{
myEle.text = "无";
}
}

解决方案 »

  1.   

    try:function selectChange(control, controlToPopulate, ItemArray, GroupArray)
    {
      var myEle ;
      var x ;
      // Empty the second drop down box of any choices
     for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
     // ADD Default Choice - in case there are no values
      myEle = document.createElement("option") ;
      myEle.value = "" ;
      myEle.text = "[选 择]" ;
    var saveEle = myEle;
      controlToPopulate.add(myEle) ;
    bool bAdd = false;
    for ( x = 0 ; x < ItemArray.length  ; x++ )
        {
         if ( GroupArray[x] == control.value )
           {
         bAdd = true;
             myEle = document.createElement("option") ;
              myEle.value =x ;
             myEle.text = ItemArray[x] ;
              controlToPopulate.add(myEle) ;
            }
        }if( !bAdd )
    {
    saveEle.text = "无";
    }
    }
    这次应该没问题,刚刚是我太不小心了,没仔细看。