子視窗傳值給母視窗後子視窗關閉

  • Share this:

<!- 母視窗 parent.htm -> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> </head> <form name=parent action="parent.htm" METHOD="POST" > <table border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <input type="text" size="30" name="child" > <a href="javascript:openWindow('child.htm','d2','scrollbars=yes,status=no,resizable=yes,width=300,height=400,top=80,left=630')"> <img src="https://images.unsplash.com/photo-1514448292272-31510d2cfca3?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=320&w=640" data-src="https://images.unsplash.com/photo-1514448292272-31510d2cfca3?crop=entropy&cs=tinysrgb&fit=crop&fm=jpg&h=320&w=640" border="0" hspace=3></a> </td> </tr> ''' ''' ''' ''' </table> </form> </html> <!- 子視窗 child.htm -> <script language="javascript"> function choice() { opener.document.parent.child.value = document.file1.parent.value ; self.close(); } </Script> <form name=file1> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td> <form> <input type="text" size="10" name="parent" onChange='choice()'> </form> </td> </tr> </table> </form>


Tags: