我是个菜鸟,问的问题也菜,大家帮给忙

zdmaster 2003-12-29 11:51:21
现在有个add.asp文件,如何在页面上点击一个按钮之类的东东弹出一个新窗口2.asp(最好新窗口大小能设定,状态栏菜单都没有),在2.asp的文本框中输入,点击2.asp中的按钮关闭2.asp,返回add.asp,并且把输入的内容显示在add.asp的一个文本框中。
请给我写段代码,我很菜的。呵呵,拜托了!!!
...全文
47 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
任老先生 2003-12-29
  • 打赏
  • 举报
回复
哈哈,来晚了。up
winson79 2003-12-29
  • 打赏
  • 举报
回复
在1.asp中加
<% text=request("txt")
<script language="JavaScript">
<!--
function run(){
window.open('aaa.asp', '', '100, width=800,height=500, top=100, left=100, toolbar=no, menubar=no, scrollbars=yes,resizable=no,location=no, status=no')
}
//-->
</script>
<% response.write "<a href=javascript:run()>超级联接</a>"%>
在2.asp中
<form>
<input name="txt">
</form>
ShiningstarHu 2003-12-29
  • 打赏
  • 举报
回复
add.asp

<input type=textbox name="txtField" id="txtField">

<input type=button value="Add" onclick="window.open('2.asp','newWin','toolbars=no,width=800,height=600');">

-----------------------------------------------------------
2.asp

<input type=textbox name="txtTEXT" id="txtTEXT">
<input type=button value="Close" onClick="window.opener.document.all.txtField.value=txtTEXT.value;window.close();">
仙人掌 2003-12-29
  • 打赏
  • 举报
回复
都用javascript客户端脚本来实现

1
function openWindow(url, width, height){
var vleft=window.screen.width/2 -250;
var vtop=window.screen.height/2 -150;
var Win = window.open(url,"","width=" + width + ",height=" + height + ",left="+vleft+",top="+vtop+",resizable=0,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");
}

2
使用showModalDialog
shijian58 2003-12-29
  • 打赏
  • 举报
回复
<script language=javascript>
<!-- Hide
var newWindow = null
function windowOpener(loadpos)
{
if (! newWindow || newWindow.closed)
{
newWindow = window.open(loadpos,"surveywin","toolbar=no,resizable=no,scrollbars=no,dependent=no,width=400,height=280");
}else
{
newWindow.focus();
}
}
//end-->
</SCRIPT>
<form method="POST" action="vote.asp" onSubmit="windowOpener('')" target="surveywin">
<td width="46%" height="90" align="left" valign="middle" background="images/a2.jpg">
<table width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" border="0" >
<tr >
<td width="281"><font size="2">   <font color="#CC9900"><strong>您希望增加哪些内容?</strong></font></font></td>
</tr>
<tr>
<td align="left"> <input type="radio" name="selected" value="1">
<%=trim(rs("select1"))%> <input type="radio" name="selected" value="2">
<%=trim(rs("select2"))%><br> <input type="radio" name="selected" value="3">
<%=trim(rs("select3"))%> <input type="radio" name="selected" value="4">
<%=trim(rs("select4"))%></td>
</tr>
<tr>
<td> <div align="center">
<input type="submit" value="投票" name="submit">
   
<input type="button" value="查看" onClick="windowOpener('view.asp')">
</div></td>
</tr>
</table></td>
</form>

28,407

社区成员

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

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