在jsp程序中嵌入了一段javascript,但是在ie中浏览时看不到效果怎么回事呀。在线急用!!!

zhigangsun 2003-11-25 04:16:55
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="seasunh.comm.dataAccess.*"%>
<%@ page import="seasunh.comm.exception.*"%>
<%@ page import="seasunh.common.*"%>
<%@ page import="seasunh.ysquery.*"%>
<html>
<head>
<title>
选择查询条件
</title>
</head>
<script language=javascript>
function Do(selected) {
var select;
if((selected=="年销售预测表")||(selected=="月销售预测表")){
document.forms[0].xsyc.parentElement.style.display="";
document.forms[0].deptname.parentElement.style.display="none";
document.forms[0].hkyc.parentElement.style.display="none";
}
else{
if((selected=="年回款预测表")||(selected=="月回款预测表")){
document.forms[0].hkyc.parentElement.style.display="";
document.forms[0].deptname.parentElement.style.display="none";
document.forms[0].xsyc.parentElement.style.display="none";
}
else{
document.forms[0].hkyc.parentElement.style.display="none";
document.forms[0].xsyc.parentElement.style.display="none";
document.forms[0].deptname.parentElement.style.display="";
}

}
}
/*if(addTitle=="01") {
title="现金收款凭证"
ino_Id=document.myform.type1.value;
}
if(addTitle=="02") {
title="现金付款凭证"
ino_Id=document.myform.type2.value
}

if(addTitle=="03") {
title="银行收款凭证"
ino_Id=document.myform.type3.value
}

if(addTitle=="04") {
title="银行付款凭证"
ino_Id=document.myform.type4.value
}

if(addTitle=="转") {
title="转帐凭证 "
ino_Id=document.myform.typezh.value
}
document.myform.title.value=title;
document.myform.title.style.color ="#0FCCCC"
document.myform.ino_Id.value=ino_Id;
}*/
</script>
<%!
String deptsql="";
String passdep="";
String tabletypeno="";
String tabletypename="";
String dept="";
String deptno="34";
String deptname="";
String selfname="";
String clientyear="";
String currentyear="";
String currentmonth="";
java.util.ArrayList deptlist=new java.util.ArrayList();
java.util.ArrayList tabletypelist=new java.util.ArrayList();
java.util.HashMap deptrecorder=new java.util.HashMap ();
java.util.HashMap tabletyperecorder=new java.util.HashMap();
%>
<body bgcolor="#ffffff">
<form method=post name= form1 action=conditionjudge.jsp>
<jsp:useBean id="PubInfo" scope="session" class="seasunh.common.PublicInfo">
</jsp:useBean><!--调用bean来获取登陆用户身份!-->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<%
//clientyear=request.getParameter("clientyear");
//deptno=PubInfo.getUserDepCode();
//name=PubInfo.getKeyWord();
TableType tabletype=new TableType();
DBAccess dbAccess=new DBAccess();
DBAccess db=new DBAccess();
U8_Department u8_department=new U8_Department();
u8_department.codetoName(deptno);
selfname=u8_department.getCDepName();
deptsql="select distinct CDepCode from Bud_PassTb where PassDep='"+deptno+"' and (IsSpecial='0' or IsSpecial='2')";
try{
deptlist=dbAccess.execute(deptsql);
}
catch(IHIRException e){
System.out.print(e.getStrErrMessage());
}
%>
<input type=hidden name=officeno value=<%=deptno%>>
<tr><td><select name=deptname size=1>
<option><%=selfname%></option>
<%
if(deptlist.size()!=0){
for(int i=0;i<deptlist.size();i++){
deptrecorder=(java.util.HashMap) deptlist.get(i);
dept=(String) deptrecorder.get("CDepCode");
//u8_department.setCDepCode(deptno);
try{
u8_department.codetoName(dept);
deptname=u8_department.getCDepName();
}
catch(OurException e){
System.out.print(e.getStrErrText());
}
%>
<option><%=deptname%></option>
<%
}
}
%>
</td></tr>
</select>             
<tr><td>
<BR><BR><select name=tablename size=1 onchange="Do(this.options[this.selectedIndex].value)">
<%
String tabletypesql="select distinct TableType from Bud_PassTb where PassDep='"+deptno+"' and (IsSpecial='0' or IsSpecial='2')";
try{
tabletypelist=db.execute(tabletypesql);
}
catch(IHIRException e){
System.out.print(e.getStrErrText());
}
if(tabletypelist.size()!=0){
for(int i=0;i<tabletypelist.size();i++){
tabletyperecorder=(java.util.HashMap) tabletypelist.get(i);
tabletypeno=(String) tabletyperecorder.get("TableType");
try{
tabletype.setTableType(tabletypeno);
tabletype.TableNameQry();
tabletypename=tabletype.getTableName();
}
catch(OurException e){
System.out.print(e.getStrErrText());
}
%>
<option value=<%=tabletypename%>><%=tabletypename%></option>
<%
}
}
%></td></select>
<BR><BR><td>
<input type=radio name=xsyc value=depart checked > 按办事处查看
<input type=radio name=xsyc value=product >按产品查看</td>
<BR><BR>
<Td><input type=radio name=hkyc value=depart checked>按办事处查看
<input type=radio name=hkyc value=custom >按客户查看</td>
</tr>
</table>
<br><BR><BR>
<%
java.util.Date date =new java.util.Date();
DateandString dateandstring =new DateandString();
currentmonth=dateandstring.getMonth(date);
currentyear=dateandstring.getYear(date);
%>
请输入您要查询表单的年度(默认为当前年份):<input type=text name=clientyear size=4 value=<%=currentyear%>><br>
请输入您要查询表单的月份(默认为当月):           <input type=text name=month size=4 value=<%=currentmonth%>>
<BR><br><br><input type=submit value="查询">
</form>
</body>
</html>
...全文
26 点赞 收藏 1
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jyuhua 2003-11-25
修改原代码:
<select name=tablename size=1 onchange="Do(this.options[this.selectedIndex].value)">
为:
><select name=tablename size=1 onchange="Do(this.options[this.selectedIndex].text)">

请试试
回复
发动态
发帖子
JavaScript
创建于2007-09-28

8.4w+

社区成员

Web 开发 JavaScript
申请成为版主
社区公告
暂无公告