1

我收到 options[text] 为 null 或不是对象错误。我在这里要做的是检查选择了所有多选查找列值,将它们与数组中的值进行比较,然后删除它们

  var responsibleselected = returntags("select","Responsibility selected values");
  for(var i=0;i<responsibleselected.options.length;i++)
  {
       if(responsibleselected.options[i].selected == true)
          {
           for(var j=0;j< ResponsibleArray.length;j++)
            {
 if(responsibleselected.options[i].text == ResponsibleArray[j])//throws error here
             {
       GipRemoveSelectedItems(ctl00_m_g_6ad915a8_68ea_4c76_b67a_ad1215320288_ff391_ctl00_ctl00_MultiLookupPicker_m); 
             }
            }
          }
  }
4

1 回答 1

0

而不是.text你需要.textContent

if(responsibleselected.options[i].textContent == ResponsibleArray[j]){
                                  //   ^--------------here it is
于 2012-07-09T07:58:40.557 回答