返回多个值的办法:
1,拼成一个字符串
2,用数组new Array("值1","值2")

解决方案 »

  1.   

    window.opener.document.getElementById('hiddenid').value = "值一" + "值2"
      

  2.   

    document.opener.formname.all[elementName].value="value1"+"value2"
      

  3.   

    opener.document.formname.hiddenname.value="a|b"
    然后在父窗口
    var str=opener.document.formname.hiddenname.value
    arr=str.split("|")
    alert(arr[0])
    alert(arr[1])
      

  4.   

    纠正一下是opener.document.formname.all[elementName].value="value1"+"value2"
      

  5.   

    父窗口:
    <script language="javascript"> 
    <!-- 
    function openChild()

    var k = window.showModalDialog("child.html",window,"dialogWidth:335px;status:no;dialogHeight:300px"); 

    //--> 
    </script> 
    <input type ="button" value="openChild" onclick="openChild()"> 
    子窗口置入的值:<input id="txt2" type="text">子窗口:
    请输入要置入父窗口的值:<input id="txt1" type="text"><input type ="button" value="置入父窗口" onclick="setFather()">
    <script language=javascript> 
    <!-- 
    var k=window.dialogArguments; 
    function setFather() 

     k.document.getElementById("txt2").value = document.getElementById("txt1").value 

    //--> 
    </script>
      

  6.   

    opener.document.all.hid1.value='111'
    opener.document.all.hid2.value='222'
      

  7.   

    如果子窗口传的是radio呢?明天结贴
      

  8.   

    <INPUT id="txt1" name="myradio" type="radio">
    <input type ="button" value="置入父窗口" onclick="setFather()">
    <script language=javascript> 
    <!-- 
    var k=window.dialogArguments; 
    function setFather() 
    {
    if(document.getElementById("txt1").checked) 
    k.document.getElementById("txt2").value = "你要传的值"

    //--> 
    </script>
      

  9.   

    接收的是radio的值
    <INPUT id="txt1" name="myradio" type="radio" value="要传的值">
      

  10.   

    <INPUT id="txt1" name="myradio" type="radio" value="要传的值">
    <INPUT id="txt1" name="myradio" type="radio">
    <input type ="button" value="置入父窗口" onclick="setFather()">
    <script language=javascript>
    <!--
    var k=window.dialogArguments;
    function setFather()
    {
    if(document.getElementById("txt1").checked)
    k.document.getElementById("txt2").value = document.getElementById("txt1").value;
    }
    //-->
    </script>
      

  11.   

    function getRadioValue(radios){
        for(var i=0;i<radios.length;i++){
            if(radios[i].checked){
                return radios[i].value;
            }
        }
        return "";
    }
    var radios = document.getElementsByName("myradio");
    var radioValue = getRadioValue();
      

  12.   

    从n个radio中选择一个出来传回父窗口
      

  13.   

    function getRadioValue(radios){
        for(var i=0;i<radios.length;i++){
            if(radios[i].checked){
                return radios[i].value;
            }
        }
        return "";
    }
    var radios = document.getElementsByName("myradio");
    var radioValue = getRadioValue(radios);