window.opener.form1.xbm.value 是不是这个呀

解决方案 »

  1.   

    to: lbd8848(lbd) 
    按你说的改了
    还是不对
      

  2.   

    代码没有错,你检查下你的父窗口的表单名是否为form1.以及有没有xbm和xb这两个文框。
      

  3.   

    你的form定义名称了吗?<form name="form1">......
    </form>
      

  4.   

    可以呀
    a.asp
    ------
    <body>
    <form name=form1>
    <input type=text name=a1 value="ddddd">
    <input type=text name=a2 value="ccccc">
    <input type=button value="ddddxxxx" onclick="window.open('b.asp','','')">
    </form>
    </body>
    b.asp
    ---------
    <script language="JavaScript">
    {
    alert(window.opener.form1.a1.value);
    }
    </script>
      

  5.   

    父窗口select.htm
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>&sup2;&Euml;&micro;&yen;</title>
    <script language="JavaScript">
    <!--
    function fPopUpCalendarDlg(ctrlobj,dbname)
    {
    showx = event.screenX - event.offsetX - 4 - 210 ; 
    showy = event.screenY - event.offsetY + 18; 
    newWINwidth = 210 + 4 + 18; retval = window.showModalDialog("select1.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:no;scrollbars:no;Resizable=no; "  );
    if( retval != null ){
    document.all[ctrlobj].value = retval;
    }else{

    }
    }
    //---></script>
    <LINK href="../css/style.css" rel=stylesheet type=text/css>
    </head>
    <body leftmargin="0" topmargin="0">
    <form name="form1" method="post" action="">
      <table width="600" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr bgcolor="#FFFFFF"> 
          <td width="100" align="center">&ETH;&Ocirc;±&eth;</td>
          <td><input name="xb" type="text" size="10" value="" readonly>
      <input name="xbm" type="hidden" value="">
            <img style="CURSOR: hand" onClick="fPopUpCalendarDlg('xbm','gb_t2261');return false;" src="../images/add.gif" width="15" height="12"></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td>&nbsp;</td>
      <td>&nbsp;</td>
        </tr>
      </table>
    </form>
    </body>
    </html>子窗口select1.htm
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>&Ntilde;&iexcl;&Ocirc;&ntilde;±ê×&frac14;&acute;ú&Acirc;&euml;</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <SCRIPT language=JavaScript>
    <!--
    function InsertDate(name,code)  
    {
        opener.form1.xb.value = name;
    opener.form1.xbm.value = code;
    window.close();
    }
    //---></SCRIPT>
    <LINK href="&Ntilde;&iexcl;&Ocirc;&ntilde;±ê×&frac14;&acute;ú&Acirc;&euml;.files/style.css" type=text/css 
    rel=stylesheet>
    <META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
    <BODY leftMargin=0 topMargin=0>
    <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0>
      <TBODY>
      <TR onmouseover="this.bgColor='#eeeeee';" onmouseout="this.bgColor='#FFFFFF';" 
      align=middle>
        <TD onclick=InsertDate('男',0);>男</TD></TR>
      <TR onmouseover="this.bgColor='#eeeeee';" onmouseout="this.bgColor='#FFFFFF';" 
      align=middle>
        <TD onclick=InsertDate('女',1);>女</TD></TR>
      <TR onmouseover="this.bgColor='#eeeeee';" onmouseout="this.bgColor='#FFFFFF';" 
      align=middle>
        <TD onclick=InsertDate('未知的性别',2);>未知的性别</TD></TR>
      <TR onmouseover="this.bgColor='#eeeeee';" onmouseout="this.bgColor='#FFFFFF';" 
      align=middle>
        <TD onclick=InsertDate('未说明的性别',9);>未说明的性别</TD></TR></TBODY></TABLE>
    </BODY></HTML>再帮我看看
    还是找不出错在那儿了
      

  6.   

    http://community.csdn.net/Expert/topic/3161/3161503.xml?temp=.4632532