parent.form名.下拉表单名
其他不用说了吧

解决方案 »

  1.   

    把子窗口里的option值写到数组里面,然后再把数组传给父窗口
      

  2.   

    父窗口代码如下:<html>
    <head>
    <title>无标题文档</title>
    </head>
    <body>
    <script>
    function DoPop()
    {
         window.open("NewTestPopWnd.asp","","");
    }
    function AddSelectItem(value)
    {
         MySelect.options[MySelect.options.length] = new Option(value,value);
    }
    </script>
    <select id="MySelect" style="width:120px;"></select>
    <button onClick="DoPop()">弹出子窗口</button>
    </body>
    </html>弹出的子窗口NewTestPopWnd.asp代码如下:<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head>
    <body>
    <script>
    function CreateSelect()
    {
       for(var i = 0  ;i < 3 ;i ++)
       {
           var length =  ChildSelect.options.length ;
       var value  =  "value" + i ;
           ChildSelect.options[length] = new Option(value,value);
    }
    }
    function PassToParent()
    {
       if(ChildSelect.options.length <=0 )
       {
          alert("当前select里没有值,请点击按钮创建新值");
          return;
       }
        if(window.opener)
       {
           for(var i = 0 ; i < ChildSelect.options.length ; i ++)
       {
            var value = ChildSelect.options[i].innerText ;
    window.opener.AddSelectItem(value);
       }
       } 
    }
    </script>
    <select id="ChildSelect" style="width:120px;"></select>
    <button onClick="CreateSelect()">在select里新增值</button>
    <button onClick="PassToParent()">将select里的值传到父窗口</button>
    </body>
    </html>win2000,IE6。0下测试通过 。 。。
      

  3.   

    如果父窗口是文本筐呢?我是这样写的:
    window.opener.form.checked_person1.value=form.checked_person.options[form.checked_person.selectedIndex].text;
    可这样只能穿一个值过来,我想把全部下拉列表的全部传过来
      

  4.   

    请看下面这行代码:
     for(var i = 0 ; i < ChildSelect.options.length ; i ++)
     {
          var value = ChildSelect.options[i].innerText ;
          window.opener.AddSelectItem(value);
     }
    上面每次循环得到的value值,就是Select里的options值 。 。 。
    你只要用ChildSelect.options[i].innerText ,就可以得到下拉列表第i个元素的值得到每个值以后,你就可以传过去了。
      

  5.   

    <%@ page contentType="text/html;charset=gb2312" %>
    <script language="JavaScript">
    var x={};//成员
    var aryArg = new Array;//数组记录名称
    var aryArg1 = new Array;//数组记录id
    function getCheckboxsValue(cbfield,kk,rr){
    if(cbfield.checked){
    x[kk]=rr;//定义成员
    }else{
    delete x[kk]
    }
    }function ffff(){
    var i=0;
    for(var i in x){
    aryArg[aryArg.length]=x[i];
    }
    if(i==0){
    alert("ddd");
    return;
    }var j=0;
    for(var j in x){
    aryArg1[aryArg1.length]=j;
    }window.opener.ffff.AllID.value=aryArg.join();
    window.opener.ffff.sel.length = aryArg.length;
    for(var j=0;j<aryArg.length;j++){
    window.opener.ffff.sel.options[j].text=aryArg[j]
    }
    for(var q=0;q<aryArg1.length;q++){
    window.opener.ffff.sel.options[q].value=aryArg1[q]
    }
    window.close();}</script>
    <form name="www">
    <input type="checkbox" name="FormName1" onclick="getCheckboxsValue(FormName1,'1','东方不败1')">东方不败1<br>
    <input type="checkbox" name="FormName2" onclick="getCheckboxsValue(FormName2,'2','东方不败2')">东方不败2<br>
    <input type="checkbox" name="FormName3" onclick="getCheckboxsValue(FormName3,'3','东方不败3')">东方不败3<br>
    <input type="checkbox" name="FormName4" onclick="getCheckboxsValue(FormName4,'4','东方不败4')">东方不败4<br>
    <input type="checkbox" name="FormName5" onclick="getCheckboxsValue(FormName5,'5','东方不败5')">东方不败5<br>
    <input type="checkbox" name="FormName6" onclick="getCheckboxsValue(FormName6,'6','东方不败6')">东方不败6<br>
    <input type="checkbox" name="FormName7" onclick="getCheckboxsValue(FormName7,'7','东方不败7')">东方不败7<br>
    <input type="text" name="TextName">
    <input type="button" value="ddd" onclick="ffff()">
    </form>