在窗口中,用javascript打开模态窗口,在模态窗口中点击按钮,给父窗口的控件赋值(一共有6个个控件),用js怎么写啊?
解决方案 »
- fckeditor 上传图片时怎么把路径传到数据库里;或者当image文件夹中添加一张图片时立即就往数据库中添加其名称
- GridView列头合并问题
- datalist之外怎么实现对DataList数据的操作啊?
- AdRotator控件广告点击没反应
- 关于登录验证的问题,为什么要使用验证码?
- 在FireFox下,如何创建和读取Cookie呢?
- DataGrid导出EXCEL后出现的问题--(在框架中点击其它链接没反应)
- IIS:代码不变,改NTFS后数据库拒绝访问,请问如何设定权限?
- 我的程序Xml里面为什么不能存中文??/
- #的web程序中如何在frameset中建tree
- 孟子、webdiyer、LoveCherry等高手请进!!!比较麻烦的问题
- Request在什么命名空间下?
我看了这个网址的资料,参照上面的说明写了代码,但是发现一个奇怪的问题,当模态窗口关闭的时候,赋给父窗体TextBox中的值都被清空了,不知道怎么回事...
代码如下:打开窗体:
window.showModalDialog("ModuleCategorySelect.aspx",window,"dialogWidth:550px;dialogHeight:580px;status:no;directories:yes;scrollbars:no;Resizable=no;");模态窗口给父窗体赋值:
var id1 = window.document.getElementById("hidCategory1").value;
var text1 = window.document.getElementById("txtCategory1").value;
if(id1!= "" && text1!="")
{
window.dialogArguments.document.getElementById("hidCategory1").value=id1;
window.dialogArguments.document.getElementById("txtCategory1").value=text1; }
var id2 = window.document.getElementById("hidCategory2").value;
var text2 = window.document.getElementById("txtCategory2").value;
if(id2!="" && text2!="")
{
window.dialogArguments.document.getElementById("hidCategory2").value=id2;
window.dialogArguments.document.getElementById("txtCategory2").value=text2;
}
var id3 = window.document.getElementById("hidCategory3").value;
var text3 = window.document.getElementById("txtCategory3").value;
if(id3!="" && text3!="")
{
window.dialogArguments.document.getElementById("hidCategory3").value=id3;
window.dialogArguments.document.getElementById("txtCategory3").value=text3;
}
window.close();