.net页面传值

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
<HTML>  
<HEAD>  
  <TITLE> New Document </TITLE>  
     
    <script type="text/javascript">  
           
        function openWindow() {   
            var result  = window.showModalDialog("childen.html","DialogHeigth=40,DialogWidth:100px,location:no,menubar:no,toolbar:no,status:no");  
               
            if(result)   
                document.getElementsByName("content")[0].value=result;   
        }   
  
    </script>  
  
</HEAD>  
  
<BODY>  
    <input type="button" value="打开新窗口" onclick="openWindow()">  
    <hr>  
    这是父窗口<br>  
    <input type="text" name="content" >  
</BODY>  
</HTML> 

子页面

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
<HTML>  
<HEAD>  
  <TITLE> New Document </TITLE>  
     
    <script type="text/javascript">  
        function execute() {   
            window.returnValue = document.getElementsByName("content")[0].value;   
            window.close();   
        }   
    </script>  
</HEAD>  
  
<BODY>  
    <input type="text" name="content" value="这是子窗口">  
    <input type="button" value="确定" onclick="execute()">  
</BODY>  
</HTML> 

 

posted on 2012-02-28 15:18 青蛙學堂 阅读(144) 评论(1)  编辑 收藏 引用 所属分类: 軟件布袋

评论

# re: .net页面传值 2012-02-28 15:22 repeater

子页面传值给父页面

父页面
<html>
<head>
</head>
<body>
<input type="text" id="test"/><a href="javascript:window.showModalDialog('child.html',document.getElementById('test'))">子页面</a>
</body>
</html>
复制代码
子页面
<html>
<head></head>
<body>
<input type="text" id="input"/>
<a href="javascript:window.dialogArguments.value=document.getElementById('input').value;window.close();">确定</a>
</body>
</html>  回复  更多评论   

只有注册用户登录后才能发表评论。
<2006年2月>
2930311234
567891011
12131415161718
19202122232425
2627281234
567891011

导航

统计

常用链接

留言簿(8)

随笔分类

随笔档案

收藏夹

青蛙学堂

最新评论

阅读排行榜

评论排行榜