弹出窗口 在子窗口中返回值给父窗口

parent:
ExpandedBlockStart.gif ContractedBlock.gif < script > dot.gif
InBlock.gif        
function openDialog2(srcW,srcH,srcU,sl) 
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
var X=0;
InBlock.gif            
var Y=0;
InBlock.gif            
var Cstyle;
InBlock.gif            X
=(screen.width-srcW)/2;
InBlock.gif            Y
=(screen.height-srcH)/2;
InBlock.gif            Cstyle 
= "dialogLeft:"+X+"px;dialogTop:"+Y+"px;dialogHeight:"+srcH+"px;dialogWidth:"+srcW+"px;help:no;status:no;scroll:"+sl;
InBlock.gif            
var sReturnVal = window.showModalDialog(srcU,window,Cstyle);
InBlock.gif            
return sReturnVal;
ExpandedSubBlockEnd.gif        }

InBlock.gif        
function GetValue()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif        
InBlock.gif            
var result=openDialog2('460','370','Pop.aspx','no');
InBlock.gif            
var ddd=result.split(";");
InBlock.gif            document.getElementById(
"txtLocation").value=ddd[1];
InBlock.gif            document.getElementById(
"txtLocationId").value=ddd[0];
InBlock.gif            document.getElementById(
"txtManager").value=ddd[2];
ExpandedSubBlockEnd.gif        }

ExpandedBlockEnd.gif        
</ script >
None.gif    
</ HEAD >
None.gif    
< body >
None.gif        
< form  id ="Form1"  method ="post"  runat ="server" >
None.gif            
< asp:textbox  id ="txtLocation"  runat ="server"  Width ="200px"  ReadOnly ="True" ></ asp:textbox >
None.gif            
< asp:textbox  id ="txtLocationId"  runat ="server"  Width ="200px"  ReadOnly ="True" ></ asp:textbox >
None.gif            
< asp:textbox  id ="txtManager"  runat ="server"  Width ="200px"  ReadOnly ="True" ></ asp:textbox >
None.gif            
< input  value ="点击选择"  onclick ="GetValue();"  type ="button" >
None.gif        
</ form >
None.gif    
</ body >

sub:
ExpandedBlockStart.gif ContractedBlock.gif < script > dot.gif
InBlock.gif        
function AddValue()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            locationID 
= document.getElementById("txtID").value;
InBlock.gif            locationName 
= document.getElementById("txtLocation").value;
InBlock.gif            manager 
= document.getElementById("txtManager").value;            
InBlock.gif            window.returnValue 
= locationID + ";" + locationName + ";" + manager;
InBlock.gif            window.close() ;
ExpandedSubBlockEnd.gif        }

ExpandedBlockEnd.gif        
</ script >
None.gif    
</ HEAD >
None.gif    
< body >
None.gif        
< form  id ="Form1"  method ="post"  runat ="server" >
None.gif            
< FONT  face ="宋体" > ID: </ FONT >
None.gif            
< asp:TextBox  id ="txtID"  runat ="server" ></ asp:TextBox >< BR >
None.gif            
< FONT  face ="宋体" > LOCATION: </ FONT >
None.gif            
< asp:TextBox  id ="txtLocation"  runat ="server" ></ asp:TextBox >< BR >
None.gif            
< FONT  face ="宋体" > MANAGER: </ FONT >
None.gif            
< asp:TextBox  id ="txtManager"  runat ="server" ></ asp:TextBox >< BR >
None.gif            
< input  id ="LocationAndManager"  type ="hidden"  runat ="server" >
None.gif            
< br >
None.gif            
< input   type ="button"  value ="确定"  onclick ="AddValue();" >
None.gif        
</ form >
None.gif    
</ body >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值