首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

这种有关问题应该怎么处理呀

2012-01-23 
这种问题应该怎么办呀?在主页面我点一按钮弹出一个新对话框,当我关闭这个新对话框时,如何才能将新对话框的

这种问题应该怎么办呀?
在主页面我点一按钮弹出一个新对话框,当我关闭这个新对话框时,如何才能将新对话框的值写到我的主页面的某个文本框并显示出来,关闭新窗体时好像原来的页面不会刷新!!

[解决办法]
使用showModalDialog()
[解决办法]
1.html
<script type= "text/javascript ">
function btnOpen_Click()
{
//document.MainForm.txtValue.value = window.open( "2.html ", null, "height=300,width=300,status=no,toolbar=no,menubar=no,location=no ");
document.MainForm.txtValue.value = window.showModalDialog( "2.html ");
}
</script>
<form name = "MainForm ">
<input type = "button " value= "Click " name = "btnOpen " onClick= "btnOpen_Click(); " />
<input type = "text " name = "txtValue " />
</form>


2.html
<script type= "text/javascript ">
function btnOpen_Click()
{
window.returnValue = document.Form1.txtValue.value;
alert (document.Form1.txtValue.value);
window.close();
}
</script>
<form name = "Form1 ">
<input type = "button " value= "Click " name = "btnOpen " onClick= "btnOpen_Click(); " />
<input type = "text " name = "txtValue " />
</form>

热点排行