<select id = Sel1>
         <option>AA
         <option>BB
         <option>CC
         <option>AA
         <option>BB
         <option>DD
       </select><br/>Source          
           <input type = button value = Add onclick = "Add()">
<select id = Sel2>
      </select><br/>Target
<script>function Add()
 {
   YesIt = false;
   SelectText = Sel1.options[Sel1.selectedIndex].text;
   for (i = 0 ;i < Sel2.length ; i++)
   {
     if (Sel2.options[i].text == SelectText)
     {
        alert("Target中已经存在!");
        YesIt = true;
     }
   }
   if (YesIt == false)
   {
     Sel2.options.add(new Option(SelectText));
     YesIt = true;
   }
   if (Sel2.length == 0)
   {
     Sel2.options.add(new Option(SelectText));
   }
 }
</script>

解决方案 »

  1.   

    我想了一下,这样做好像有些欠妥。
    如果可以在动态插入目标select的同时,把用户email信息在主送里面去掉。
    在抄送信息里面列出的email信息就没有已经列为主送的EMAIL信息了,报送也是同样道理。那样也不用提示有重复错误。
    我的想法是这样,但是不知道具体的实施办法。
    很急,希望大家帮忙看看,如果分不够,我再加。
      

  2.   

    你的意思是不是在添加主送的 同时,过滤报送的select?