<script>
window.onload=function(){
  var val = window.opener.document.form1.LastUnid.value;
  document.form1.txt.value = val;
}</script>
<body>
  <form name="form1">
     <input type="text" name="txt">
  </form>
</body>

解决方案 »

  1.   

    同意楼上.
    也可以个元素赋予id然后用getElementById(id)来实现.
      

  2.   

    <script> 
    window.onload=function(){ 
        var val = window.opener.document.form1.LastUnid.value; 
        var ele = document.getElementById("myTxt"); 
        ele.value = val;

    </script> 
    <body> 
        <form   name="form1"> 
              <input id="myTxt"  type="text"   name="txt"> 
        </form> 
    </body> 
      

  3.   

    window.opener.document.form1.LastUnid.value
    这个我估计你在FF下不兼容。
    尽量使用兼容的写