弹出窗口回传值

本文主要讨论 window.showModalDialog 方式弹出窗口回传值给主窗口

 

主窗口中的函数
sub subname1
dim returnvalue
returnvalue=window.showModalDialog("namelist.asp","","dialogheight:380px;dialogtop:100px;dialogleft:100px;dialogwidth:100px;toolbar:no;menubar:no;scrollbars:no;resizable:no;location:no;status:no;")
form1.name.value=returnvalue
end sub

 

弹出窗口中:
sub choosename()
window.returnvalue=form1.name.value '回传值
window.close    '关闭弹出窗口
end sub

 

需要注意的是,不能采用 window.opener 来获得主窗口

以下摘自《microsoft Dhtml html & Css reference》中对window.showModalDialog返回值的说明:
Return Value
Variant. Returns the value of the returnValue property as set by the window of the document specified in sURL.

 

参看opener的说明:


Sets or retrieves a reference to the window that created the current window.

window.opener [ =sWindow ] 

Possible Values: sWindow String that specifies the window reference.
The property is read/write with no default value.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值