我现在 只能通过单选按钮传一个名字 到文本框
function getSubWindowValue(id)
{
var l,i
l=document.subform.radiobutton.length;
//先判断是否为多条记录.
if(l)
{
  for(i=0;i<l;i++)
  {
    if (document.subform.radiobutton[i].checked==true)
    {
        window.dialogArguments.document.myform.wuye.value=document.subform.radiobutton[i].value;
    }
  }
}
else
{
    if (document.subform.radiobutton.checked==true)
    {
window.dialogArguments.document.myform.wuye.value=document.subform.radiobutton.value;
    }
}
window.close();
}

解决方案 »

  1.   

    demo.htm<script>
    function openWin()
    {
        var sReturn = window.showModalDialog("in.htm","","dialogHeight:200px;dialogWidth:400px");
        var sPname = sReturn.split("|")[0];
        var sPrice = sReturn.split("|")[1];
        document.all.spname.value = sPname;
        document.all.sprice.value = sPrice;
    }
    </script>
    <a href="JavaScript:openWin()">OpenWin</a>
    <input type="text" name="spname">
    <input type="text" name="sprice">
    in.htm<script>
    function SubIt()
    {
        var sPname = document.all.pname.value;
        var sPrice = document.all.price.value;
        var sReturn = sPname+"|"+sPrice;
        window.returnValue = sReturn;
        window.close();
    }
    </script>
    <form>
    pname:<input type="text" name="pname"><br>
    price:<input type="text" name="price"><br>
    <input type="button" value="确定" onclick="SubIt()">
    </form>
      

  2.   

    单选按钮的value值是 名称和价格