先在子窗口定义个Function
function GetShowName(inName){
   document.getEmlemetById("name1").value=inName;
}
//父窗口的句柄
var winPer=window.dialogArguments;
winPer.GetShowName(B.X);

解决方案 »

  1.   

    test.html
    <body>
    <input name=uname>
    <input type=button onclick=window.open("a.htm") value=选择>
    </body>a.html
    <script>
    function setvalue(v){
    window.opener.document.all.uname.value=v//该值可改为由数据库获得
    //window.opener.document.getElementById("test").innerHTML="由数据库获得"
    opener=null;
    self.close();
    }</script>
    <body>
    <select name=user>
    <option value=人员1>人员1</option>
    <option value=人员2>人员2</option>
    <option value=人员3>人员3</option>
    </select>
    <input onclick=setvalue(user.value) type=button>
    </body>
      

  2.   

    window.opener.document.all.uname.value=v//该值可改为由数据库获得==>
    window.opener.document.getElementById("uname").innerHTML=v//该值可改为由数据库获得