各位看看这个问题....

vc_boy 2003-10-16 02:49:26
我有一个页面,其中有一个输入框,现在想实现这样的功能.
边上有一个图片,点击图片后弹出一个新窗口,其中显示了一些可选择的信息,选择后关闭此页面.然后在原页面中的输入框中显示出选择的内容.

这如何实现?
是否要刷新一次原页面?如果不刷新可否?
...全文
38 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
slumcherry 2003-10-16
  • 打赏
  • 举报
回复
<HTML>
<HEAD>
<TITLE>Master of all Windows</TITLE>
<SCRIPT LANGUAGE="JavaScript1.1">
var myWind
function doNew()
{
if (!myWind || myWind.closed) //attention the condition of "if()"
{
myWind = window.open("opener2.htm","subWindow","HEIGHT=200,WIDTH=350,resizable")
}
else
{
// bring existing subwindow to the front
myWind.focus()
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="input">
Select a color for a new window:
<!--<INPUT TYPE="radio" NAME="color" VALUE="red" >Red-->
<INPUT TYPE="radio" NAME="color" VALUE="yellow">Yellow
<INPUT TYPE="radio" NAME="color" VALUE="blue">Blue
<INPUT TYPE="button" NAME="storage" VALUE="Make a Window" onClick="doNew()">
<HR>
This field will be filled from an entry in another window:
<INPUT TYPE="text" NAME="entry" SIZE=25>
</FORM>
</BODY>
</HTML>



opener2.htm:

<HTML>
<HEAD>
<TITLE>New Window on the Block</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getColor()
{
// shorten the reference
colorButtons = self.opener.document.forms[0].color
// see which radio button is checked
for (var i = 0; i<colorButtons.length; i++)
{
if (colorButtons[i].checked)
{
return colorButtons[i].value
}
}

return "white"
}
//-->
</script>
</HEAD>
<!--<SCRIPT LANGUAGE="JavaScript">
document.write("<BODY BGCOLOR='" + getColor() + "'>")
</SCRIPT>-->
<body BGCOLOR="getColor()"> <!--there is the problem-->
<H1>This is a new window.</H1>
<FORM>
<INPUT TYPE="button" VALUE="Who's in the Main window?" onClick="alert(self.opener.document.title)">
Type text here for the main window:
<INPUT TYPE="text" SIZE=25 onChange="self.opener.document.forms[0].entry.value = this.value"><!--attention "this.vlaue"-->
</FORM>
</BODY>
</HTML>
avonqin 2003-10-16
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/2361/2361313.xml?temp=.7313806

就是这个方法,看看吧
hwkknd 2003-10-16
  • 打赏
  • 举报
回复
原来写过的一个函数,和你要的一样,
function SelClientInfo(v)//自动弹出选择客户编号对话框
{
var strFeatures = "dialogWidth=400px;dialogHeight=300px;center=yes;help=no";
var CliNO=""
if(window.event.keyCode==13 || window.event.keyCode==113)
{
if(window.event.keyCode==113) //F2
{
CliNO=showModalDialog("ClientLst.asp?isClient="+v+"&CliNOName="+form1.CliNOName.value,0,strFeatures)
if(CliNO=="")
{
return
}

form1.CliNO.value=CliNO.substr(0,CliNO.indexOf("|"))
form1.CliNOName.value=CliNO
}
nextFocu()
}
}

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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