您的位置:程序门 -> .net技术 -> vb.net



window.showmodaldialog 回传值的问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


window.showmodaldialog 回传值的问题[已结贴,结贴人:ljd7202138]
发表于:2007-05-13 08:48:38 楼主
dim   aa   as   string
aa= " <script> "
aa+= "var   srcfile   =   'rqxz.aspx '; "       '选择日期的网页
aa+= "var   winfeatures   =   "dialogheight:   550px;   dialogwidth:   800px;center:   yes;status:   no;scroll:yes;resizable:no;edge:   raised; "; "
aa+= "var   b   =window.showmodaldialog(srcfile,   ' ',   winfeatures); "
aa+= " </script> "
怎么把window.showmodaldialog的回传值赋给本页面的一个text(比如说名字叫text1吧),   也就是说怎么把var   b的值赋给text1,用document.form1.text1.value=b
怎么不行呢?
发表于:2007-05-13 11:03:191楼 得分:0
没人管吗?
发表于:2007-05-13 14:39:052楼 得分:0
我在顶
发表于:2007-05-13 17:51:133楼 得分:0
没人回我一直顶!!!!
发表于:2007-05-13 18:09:124楼 得分:20
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>
发表于:2007-05-13 22:44:585楼 得分:0
amandag(高歌)   好人呀!但是自己已经解决了,把分给你吧!!


快速检索

最新资讯
热门点击