极度困惑,谢谢你假日期间帮我解决这个问题,关于弹出查询方面,谢谢!分数不是问题

zwyugladstone 2003-10-01 02:52:51
大家国庆节快乐!

我现在急需实现数据的查询功能,要求如下:
1、在actionCase.jsp(显示表里面所有记录)页面上有一个按钮,点击该按钮弹出一个窗口,该窗口是用来输入多个查询条件的;
2、待输入查询条件提交后,关闭查询条件输入窗口,将查询结果显示在actionSearch.jsp里面.(本来actionCase.jsp和actionSearch.jsp是在一个页面先后显示的,但是现在就是在这两者之间加一个弹出窗口,要是返回的也是actionCase.jsp到也好处理,但是现在该如何,极度困惑!)
理论上是将查询条件的输入值传递给查询处理文件,然后显示出来
但是做了几天了没有理想结果,主要是显示比较难处理,麻烦你过一个快乐的国庆节之前帮我解决这一问题,谢谢!
不知道是否表达清楚,谢谢你来给我一点力量!
...全文
18 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
zwyugladstone 2003-10-05
  • 打赏
  • 举报
回复
结了,已搞定。
谢谢各位!
zwyugladstone 2003-10-05
  • 打赏
  • 举报
回复
对不起,刚才那个少写了一个引号。
应该是:window.opener.location.href="actionSearch.jsp?fieldName1="+fieldName1+"";
但是就是不行。
why?
zwyugladstone 2003-10-05
  • 打赏
  • 举报
回复
我是这样传递值的
<script language=javascript>
function showResult()
<!--
{
try{

window.opener.location.href="actionSearch.jsp?fieldName1="+fieldName1+";
window.close();
}
catch(e){
alert("打开此页的页面已经关闭!");
location.href="actionSearch.jsp";
}

}
-->
</SCRIPT>
但是服务器报错:
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.

请问到底是哪里错了呢?
我想主要还是传递值出错,哪位大侠能帮忙指正,谢谢!
pazll 2003-10-02
  • 打赏
  • 举报
回复
对!你可以写一个过程;
function xxxx(){
var filed=document.all("fieldName1")
window.opener.location.href="actionSearch.jsp?filedName="+filed.value;
self.close();
}
然后用一个button来触发这个过程
zwyugladstone 2003-10-02
  • 打赏
  • 举报
回复
caina3(阿郎→偶什么都不会)你好,你还在线上吗?
比如我的弹出窗口中有一个框是fieldName1,是不是就这样传递:window.opener.location.href="actionSearch.jsp?fieldName1="+fieldName1+"";
但是发现不行,请问到底是哪里出问题呢?麻烦你指点,谢谢!
clare0peng 2003-10-02
  • 打赏
  • 举报
回复
剛好我最近也做了個類似的鳥東西
把這個改一下也許會對你有用的

main.htm

<html
<head>
<title>一個測試網頁</title>
</head>
<body>
<script language="JavaScript">
function voteview7()
{OpenWindow=window.open('mubiao.htm','votedo','toolbar=no,scrollbars=1,resizable=0,menubar=no,top=10,left=10,width=435,height=225')
}

function openw()
{
window.open("heart.htm","heart","status=no,scrollbars=no,width=480,height=300");
}
</SCRIPT>
<form name=form1 action="" method=post>
<table border=2 width=100%>
<td width=30%>
學號:
<td>
<input type=text name=id>
<td>姓名:
<td>
<input type=text name=name>
<td>年齡
<td>
<input type=text name=age>
<td>性別
<td>
<input type=text name=sex>
</table>
<td colspan=2 align=center>
<input type=button value="打開窗體" onClick="openw();">
</form>
</body>
</html>

heart.htm

<htmLl>
<head>
<title>彈出窗體</title>
</head>
<body>
<script language='javascript'>

function selno(val)
{
var idx;
if(document.forms[0].rec_number.value > 1)
{
for (var i = 0; i < document.forms[0].rec_number.value; i++)
{
if(document.forms[0].sel[i].checked==true)
idx = i;
}
}
else
{
idx = 0;
}
idx++;
str1= 'document.forms[0].id'+ idx+ '.value';
str2= 'document.forms[0].name'+ idx+ '.value';
str3= 'document.forms[0].sex'+ idx+ '.value';
str4= 'document.forms[0].age'+ idx+ '.value';
//str5= 'document.forms[0].addr1'+ idx+ '.value';
// str6= 'document.forms[0].fax'+ idx+ '.value';
creator = window.opener;
creator.document.forms[0].id.value = eval(str1);
creator.document.forms[0].name.value = eval(str2);
creator.document.forms[0].sex.value = eval(str3);
creator.document.forms[0].age.value = eval(str4);
//creator.document.forms[0].addr1.value = eval(str5);
//creator.document.forms[0].fax.value = eval(str6);

window.close();

return true;
}

</script>
<form>
<table border=2>
<tr>
<td>
<input type=radio name='sel' onClick="selno(this.value);">
<td>9912115<input type=hidden value=9912115 name=id1>
<td>彭xx<input type=hidden value=彭xx name=name1>
<td>男<input type=hidden value="男" name=sex1>
<td>24<input type=hidden value="24" name=age1>
<tr>
<td>
<input type=radio name='sel' onClick="selno(this.value);">
<td>9912109<input type=hidden value=9912109 name=id2>
<td>劉xx<input type=hidden value=劉xx name=name2>
<td>男<input type=hidden value=男 name=sex2>
<td>23<input type=hidden value=23 name=age2>
<tr>
<td>
<input type=radio name='sel' onClick="selno(this.value);">
<td>9912110<input type=hidden value=9912110 name=id3>
<td>蕭xx<input type=hidden value=蕭xx name=name3>
<td>男<input type=hidden value=男 name=sex3>
<td>25<input type=hidden value=25 name=age3>
<tr>
<td>
<input type=radio name='sel' onClick="selno(this.value);">
<td>9912111<input type=hidden value=9912111 name=id4>
<td>周xx<input type=hidden value=周xx name=name4>
<td>男<input type=hidden value=男 name=sex4>
<td>23<input type=hidden value=23 name=age4>
<tr>
<td>
<input type=radio name='sel' onClick="selno(this.value);">
<td>9912112<input type=hidden value=9912112 name=id5>
<td>曾xx<input type=hidden value=曾xx name=name5>
<td>男<input type=hidden value=男 name=sex5>
<td>24<input type=hidden value=24 name=age5>
<tr>
<td>
<input type=radio name='sel' onClick="selno(this.value);">
<td>9912113<input type=hidden value=9912113 name=id6>
<td>周xxxx<input type=hidden value=周xxxx name=name6>
<td>男<input type=hidden value=男 name=sex6>
<td>23<input type=hidden value=23 name=age6>
</table>
<input type=hidden name=rec_number value=6>
</form>

</body>
</html>
caina3 2003-10-01
  • 打赏
  • 举报
回复
不要么?
呵呵,忘了。
007james 2003-10-01
  • 打赏
  • 举报
回复
不要window.opener.location.reload();语句
caina3 2003-10-01
  • 打赏
  • 举报
回复
在关闭弹出窗口的时候:
window.opener.location.href="actionSearch.jsp?"+"你要传的值";
window.opener.location.reload();
如果你要传的输入值很多,可以使用session。

81,090

社区成员

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

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