我是初學.
window.open('returnunitname1.asp?spellcoding='+UnitSSN1+"&Citycode="+Citycode+"&ProvinceCode="+ProvinceCode,'register','left=180,top=255,width=250,height=380,status=no,toolbars=no,menubars=no,scrollbars=auto,resize=no');
是你開的新窗口吧..我想所有聯繫人的組織應該在這裡實現吧.
這裡也需要自己重新組織窗口

解决方案 »

  1.   

    是的,我想知道如何将returnunitname1.asp页面所有的联系人都返回到addOutSingle.asp页面
    返回去之后又如何显示
      

  2.   

    我的建議
    如果要將多個值來回傳送於對話框方塊及建立的視窗之間,應該使用陣列或者物件.下面給你個例子代碼,用來要求多個資訊以及如何傳送多個資訊回應用程序.
    <HTML>
      <HEAD>
        <TITLE>User Information</TITLE>
        <STYLE TYPE="text/css">
          BODY {margin-left:lOpt; background:menu}
        </STYLE>
        <SCRIPT LANGUAGE="JAVASCRIPT">
         function saveValues() {
             var retVal = new Array;
             for (var intLoop = 0; intLoop < document.userInfo.length;intLoop++)
                with (document.UserInfo[intLoop])
                     if (name !="")
                        retVal[name] = value;
             window.returnValue = retVal;
             event.returnValue = false;
             window.close();
         }
        </SCRIPT>
    </HEAD>
    <BODY>
       <!--此表單是用於把內容含有控制項組合而成一容易讀取得陣列 -->
       <FORM NAME="UserInfo">
         <FILEDSET>
             <LEGEND>User Information</LEGEND>
             <P>User Name: <INPUT TYPE=TEXT NAME="User">
             <P>address: <TEXTAREA ROWS="3" NAME="address"></TEXTAREA>
         </FILEDSET>
       </FORM>
       <P STYLE="text-align:center>
       <INPUT TYPE=SUBMIT STYLE="width:5em" ONCLICK="saveValues();" VALUE="OK>
       <INPUT TYPE=RESET ONCLICK="window.close();" VALUE="Cancel">
    </BODY>
    </HTML>
    假如上面檔案是在一個UserInfo.htm檔案裡面.也就相當於你的window.open里得內容
    下面程序是把上面傳回得信息顯示在一個獨占方式得對話快中.然後循環報告回傳值:
    <SCRIPT LANGUAGE="JavaScript">
        var vals = new Array();
        vars = window.showModalDialog("UserInfo.htm");
        if (vals != null) {
           strOut = "Returned values:";
           for (name in vals)
               strOut += "\n"+name+" = "+vals[name];
           alert(strOut);
        }
    </SCRIPT>
      

  3.   

    for (var intLoop = 0; intLoop < document.UserInfo.length;intLoop++)
      

  4.   

    <% If Not Rs.Eof Then 
    %>
    <% While Not Rs.Eof  Sql2="select * from personnalbaseinfo where unitssn='"&Rs("unitssn")&"' and (ProvinceCode='"&trim(request("ProvinceCode"))&"' and Citycode='"&trim(request("Citycode"))&"')"
    response.write sql2
    set rs2=server.createobject("adodb.Recordset")
    rs2.open sql2,conn,1,3
    dim person
    person=""
    While Not rs2.Eof
    person=person+rs2(personnalname)+";"
    rs2.Movenext
    Wend 
    rs2.Close
    Set rs2=Nothing
    %>
        <tr bgcolor="#FFFFFF"> 
          <td width="17"> 
            <input type="radio" name="unitname" value="<%=Rs("unitname")%>" onclick="check('<%=Rs("unitname")%>','<%=person%>','<%=Rs("Address")%>')">
          </td>
          <td width="126"><%=Rs("unitname")%></td>
          <td width="53"><%=Rs("spellcoding")%></td>
        </tr>
    <% Rs.Movenext
    Wend 
    Rs.Close
    Set Rs=Nothing
    %>
    <% Else %>
        <tr bgcolor="#FFFFFF"> 
          <td colspan=3>没有此单位</td>
        </tr>
    <% End If %>
      

  5.   

    person=person+rs2("personnalname")+";"
      

  6.   

    to : seabell(百合心);你的方法既然能将所有的联系人显示出来,但不是我想要的情况,我想要的是:联系人后要最后以下拉框的形式显示
      

  7.   

    to : YP2002CN(老婆我不敢了,老婆我愛你) ( ) 你的我也试过了,便不太明白
      

  8.   

    <script language="javascript">
     function check(t,s,m){
     opener.document.form1.Address.value=m;
    ClientDutyPerson=s.split(";");
    for(i=0;i<ClientDutyPerson.length-1;i++)
    {
     opener.document.form1.ClientDutyPerson.options[i].value=ClientDutyPerson[i];
     opener.document.form1.ClientDutyPerson.options[i].text=ClientDutyPerson[i];
     opener.document.form1.ClientDutyPerson.options.length++;
    }
    opener.document.form1.ClientDutyPerson.options.length--;  opener.document.form1.unitname.value=t;
     self.close();
     }
    </script>
      

  9.   

    谢谢 seabell(百合心) 
    我还有一个小小的请求
    请问opener.document.form1.ClientDutyPerson.options.length--;是什么意思
      

  10.   

    将主页面中input改为select
          <td width="108">单位联系人</td>
          <td width="201"> 
            <select name="ClientDutyPerson"><option></option></select>
          </td>
      

  11.   

    因为退出循环前select多加了一次长度,所以要减掉