showModalDialog

父窗口

 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2 <html>
 3   <head>
 4     <title>a.html</title>
 5     
 6     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 7     <meta http-equiv="description" content="this is my page">
 8     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 9   </head>
10   <script language="JavaScript">
11 
12   </script>
13   
14   <body>
15        <form name="form1" action="test.html" method="post" >
16                   客户id: <input type="text" name="cid" value=""    ><br>
17             客户名称<input type="text" name="cname" value=""    >
18           <input type="button" name="ok" value="请选择客户" onclick="openWin();"/>
19          </form>
20        <script type="text/javascript">
21                function openWin(){
22                 /*
23                  * vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])
24                  * 参数:
25                  *     sURL:要打开的窗口的页面。可以使用绝对路径,也可以使用相对路径
26                  *  vArguments:给sURL那个页面的窗口传递参数。
27                  *  sFeatures:控制打开的sURL那个页面的窗口的样式
28                  */
29                 window.showModalDialog("a2.html",window,"help:no;status:no;dialogHeight:150px;dialogWidth:220px");
30             }
31             function setValue(cid,cname){
32                 document.getElementById("cid").value = cid;
33                 document.getElementById("cname").value = cname;
34             }
35        </script>
36 </body>
37   
38 </html>
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-08-27
  • 2021-11-22
  • 2021-11-14
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案