showModalDialog返回值问题?

lmh79 2001-09-02 12:28:54
function unit_ref_onclick() {
var ret;
ret = window.showModalDialog("s_cust.asp", null, "font-size:9pt;dialogWidth:500px;dialogHeight:300px");
if(ret != null){
document.all.cust_code.value = ret.substring(0,ret.indexOf(" "));
}
}

s_cust.asp中怎么将我要的值传回来呢?
...全文
1342 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
kongxh1218 2010-06-08
  • 打赏
  • 举报
回复
在模式窗口的head里加这么一句
<base target="_self" />
这样翻页就不会弹出新页面了
spinner 2001-09-05
  • 打赏
  • 举报
回复
比如:A代表父窗口, B是子窗口,在A中这样写:
<script language=javascript>
var B = null
function windowOpener()
{
if (! B || B.closed)
{
B = window.open (url,"title",...);
}else
{
B.focus();
}
}
function tofocus()
{
if (!B || B.closed)
{
window.focus();
return;
}else
{
B.focus();
}
}
</script>
在A中加入对focus的响应:
<body onfocus="javascript:tofocus()"...>
这样,如果有子窗口B , 则B总被 focus, 这样就实现了模态对话框的功能。
关于返回值的问题可以这样实现:
在B中加入:
A = window.opener; //get reference of the parent window
然后可以把你的返回值记录到A中的某一个对象中:
A.document.all("text").value = returnValue;

Over!

lmh79 2001-09-05
  • 打赏
  • 举报
回复
to spinner(S):

能描述详细点吗?
spinner 2001-09-03
  • 打赏
  • 举报
回复
用showModalDialog无法实现翻页功能.
不过有补救办法:
childWindow = window.open(...),可以实现与模态对话框同样的功能(也就是说对父窗口的onfocus事件进行响应).同时也可以在父窗口中得到子窗口中的数据.
仔细想想吧!
xddy 2001-09-03
  • 打赏
  • 举报
回复
oRs.PageSize=?
oRs.AbsolutePage = page
for recordNo = 1 to oRs.PageSize
huche 2001-09-03
  • 打赏
  • 举报
回复
在对话框中用returnValues
注意大小写。
wzy9645 2001-09-03
  • 打赏
  • 举报
回复
我讨厌代码!尤其这种!!!
████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████
lmh79 2001-09-02
  • 打赏
  • 举报
回复
一个正常的翻页文件,我用showModalDialog窗体调用,然后翻页的话就新弹出窗口,这不是我希望的,我希望还是在那个窗体中翻页!
蒋晟 2001-09-02
  • 打赏
  • 举报
回复
默认是可以的啊
specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values:
dialogHeight:sHeight
Sets the height of the dialog window (see Remarks for default unit of measure).
dialogLeft:sXPos
Sets the left position of the dialog window relative to the upper-left corner of the desktop.
dialogTop:sYPos
Sets the top position of the dialog window relative to the upper-left corner of the desktop.
dialogWidth:sWidth
Sets the width of the dialog window (see Remarks for default unit of measure).
center:{ yes | no | 1 | 0 | on | off }
Specifies whether to center the dialog window within the desktop. The default is yes.
dialogHide:{ yes | no | 1 | 0 | on | off }
Specifies whether the dialog window is hidden when printing or using print preview. This feature is only available when a dialog box is opened from a trusted application. The default is no.
edge:{ sunken | raised }
Specifies the edge style of the dialog window. The default is raised.
help:{ yes | no | 1 | 0 | on | off }
Specifies whether the dialog window displays the context-sensitive Help icon. The default is yes.
resizable:{ yes | no | 1 | 0 | on | off }
Specifies whether the dialog window has fixed dimensions. The default is no.
scroll:{ yes | no | 1 | 0 | on | off }
Specifies whether the dialog window displays scrollbars. The default is yes.
status:{ yes | no | 1 | 0 | on | off }
Specifies whether the dialog window displays a status bar. The default is yes for untrusted dialog windows and no for trusted dialog windows.
unadorned:{ yes | no | 1 | 0 | on | off }
Specifies whether the dialog window displays the border window chrome. This feature is only available when a dialog box is opened from a trusted application. The default is no.

As of Microsoft® Internet Explorer 4.0, you can eliminate scroll bars on dialog boxes. To turn off the scroll bar, set the SCROLL attribute to false in the body element for the dialog window, or call the modal dialog box from a trusted application.

Microsoft® Internet Explorer 5 allows further control over modal dialog boxes through the status and resizable values in the varOptions parameter of the IHTMLWindow2::showModalDialog method. Turn off the status bar by calling the dialog box from a trusted application, such as Microsoft® Visual Basic® or an HTML Application (HTA), or from a trusted window, such as a trusted modal dialog box. These applications are considered to be trusted because they use Microsoft® Internet Explorer interfaces instead of the browser. Any dialog box generated from a trusted source has the status bar turned off by default. Resizing is turned off by default, but you can turn it on by specifying resizable=yes in the varOptions string of the IHTMLWindow2::showModalDialog method.

You can set the default font settings the same way you set Cascading Style Sheets (CSS) attributes (for example, "font:3;font-size:4"). To define multiple font values, use multiple font attributes.

The default unit of measure for dialogHeight and dialogWidth in Internet Explorer 4.0 is the em; in Internet Explorer 5 it is the pixel. The value can be an integer or floating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). For consistent results, specify the dialogHeight and dialogWidth in pixels when designing modal dialog boxes.

Although a user can manually adjust the height of a dialog box to a smaller value —provided the dialog box is resizable —the minimum dialogHeight you can specify is 100 pixels.

To override center, even though the default for center is yes, you can specify either dialogLeft and/or dialogTop.

lmh79 2001-09-02
  • 打赏
  • 举报
回复
以上问题已经解决,回答出下面问题给分!

在showModalDialog弹出的窗口中可以翻页吗,怎样实现?

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧