opener.document.getElementByName("Ma").value=M.value

解决方案 »

  1.   

    <html>
    <head><script language="JavaScript">function popw(){
      window.open('myDialog.htm','pop1','height=215,width=355,top=284,left=412,toolbar=no,menubar=no,scrollbar=no,resizable=no,location=no,status=no')
      }  function getsum() {
      a=num_1.num1.value;
      b=num_2.num2.value;
      a=parseFloat(a);
      b=parseFloat(b);
      sum=a+b;
      document.sum_v.sumV.value=sum;
      }
    function shutwin(){
    window.close();
    return;}
     </script><script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    </head>
    <body>
    <table width="800" height="441" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="441">
    <table width="400" border="1" align="center" cellpadding="2" cellspacing="2">
            <tr> 
              <td width="50"> <div align="center">姓名</div></td>
              <td width="50"> <div align="center">数学</div></td>
              <td width="50"> <div align="center">历史</div></td>
              <td width="50"> <div align="center">外语</div></td>
              <td width="50"> <div align="center">总分</div></td>
            </tr>
            <tr> 
              <td height="22" align="center">张胖胖</td>
              <td height="22"><input id="Ma" type="text" id="Ma"  width="40"></td>
              <td height="22" align="center"><input width="45" type="text" id="Hi"></td>
              <td height="22" align="center"><input width="45" type="text" id="En"></td>
              <td height="22" align="center"><input  width="45" type="text" id="Sz"></td>
            </tr>
          </table>
      <p>&nbsp;</p>
          <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td width="400">
                  <div align="center">
                    <input type="button" name="Submit" value="修改成绩" onClick="popw()">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                    <input type="button" name="Submit2" value="关闭窗口" onClick="shutwin()">
                  </div>
                </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <p>&nbsp;</p>
    </body>
    </html><html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title></title>
     <script language="JavaScript">
     function test(){
     a=this.name;
     document.te1.te.value=a;
     }
     
    function shutwin(){
    window.close();
    return;}
    function doModify(){
    var parDoc=window.opener.document.all;
    parDoc.Ma.value=form1.M.value;
    parDoc.Hi.value=form1.H.value;
    parDoc.En.value=form1.E.value;
    var sum=parseInt(form1.M.value==""?'0':form1.M.value,10)+parseInt(form1.H.value==""?'0':form1.H.value,10)+parseInt(form1.E.value==""?'0':form1.E.value,10);
    parDoc.Sz.value=sum;
    }
    </script>
    </head><body leftmargin="0" topmargin="0">
    <table width="350" height="200" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
      <tr>
        <td><form action="sum.html" name="form1" method="post"  target="sum.html">
            <table width="350" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td><div align="center">数学: 
                    <input type="text" onFocus="this.select()" name="M">
                  </div></td>
              </tr>
              <tr> 
                <td height="16"> <p align="center">历史: 
                    <input type="text" onFocus="this.select()" name="H">
                  </p></td>
              </tr>
              <tr> 
                <td><div align="center">外语: 
                    <input type="text" onFocus="this.select()" name="E">
                  </div></td>
              </tr>
              <tr> 
                <td height="40"> <div align="center"> </div>
                  <div align="center">
                    <input type="button" name="btnModify" value="修改数据" onClick="doModify()">
                    <input type="button" name="Submit2" value="关闭窗口" onClick="shutwin()">
                  </div></td>
              </tr>
            </table>
          </form></td>
      </tr>
    </table>
    </body>
    </html>