Rising Sun

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  148 随笔 :: 0 文章 :: 22 评论 :: 0 Trackbacks

 第一页1.htm
<script>
 function OpenWin(form)
{
   //showModelessDialog
   var  str = window.showModalDialog('2.htm',form,
         'dialogWidth:300px; dialogHeight:201px; center:yes');
   if(str != null)
   document.forms[0].textb.vaule = str;
   }
</script>
<form name="form1" method="post" action="" onsubmit="return false" >
<input type="text"  name="textb" />
<input type = "submit" name = "submit" value = "打开新窗口" onclick= "OpenWin(this.form);" />

</form>
第二页2.htm
<title>Dialog</title>
<script>
function back()
{
 window.dialogArguments.textb.value=document.form1.text1.value;
 self.close();
}
</script>
<body>
<form name="form1" method="post" action="#" onSubmit="back()" >
<input type="text"  name="text1" />
<input type = "submit" name = "submit" value = "返回" />
</form>
</body>

1212.gif
note :在第二页要注意一点就是 当提交的时会打一个新的窗体,把action 设为“#”,就不会这个情况。

posted on 2005-11-25 10:21 brock 阅读(880) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: