麻烦各位热心的大虾帮帮我有关在Jsp中使用日期控件出现的问题!
我在jsp中使用日期控件进行日期输入但是出现了:1、window.cele_date.style ' 为空或不是对象。2、缺少对象。两个错误!如果,奇怪的是把那个日期控件拿到另一个文件中又可以!下面是我的源代码(jsp代码应该没错,应该主要是在日期控件那里)!下面是我的源代码,有点长,麻烦了,谢谢大家!
--------------------------------------
<%@ page contentType= "text/html; charset=utf-8 " language= "java " import= "java.sql.* " errorPage= " " %>
<jsp:useBean id= "check " scope= "page " class= "mylib.dataBean " />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<%
String type= " ";
String fisttime= " ";
String lasttime= " ";
String detailid= " ";
String name= " ";
String sql= " ";
String [] par=null;
ResultSet rs=null;
request.setCharacterEncoding( "utf-8 ");
type=(String)request.getParameter( "submit ");
fisttime=request.getParameter( "time1 ");
lasttime=request.getParameter( "time2 ");
name=(String)session.getAttribute( "xm ");
if(type!=null)
{
detailid=request.getParameter( "detailid ");
if(type.equals( "通过 "))
{
sql= "update O_SOrder set IsChecked=1,Checker=? where OrderBillNo=? ";
String [] par1={name,detailid};
check.setQuerystatement(sql);
check.setParam(par1);
check.updateRecord();
}
if(type.equals( "拒绝 "))
{
sql= "update O_SOrder set IsChecked=-1,Checker=? where OrderBillNo=? ";
String [] par2={name,detailid};
check.setQuerystatement(sql);
check.setParam(par2);
check.updateRecord();
}
}
%>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=utf-8 ">
<title> 订单审核 </title>
<style type= "text/css ">
<!--
.style1 {font-size: 18px}
.style3 {font-size: 16}
-->
</style>
</head>
<body>
<form name= "form1 " method= "post " action= "ddcheck.jsp ">
<p> </p>
<table width= "781 " height= "156 " border= "0 " align= "center ">
<tr>
<td width= "75 " height= "56 "> </td>
<td width= "609 "> <span class= "style1 "> 请选择审核订单的时间范围: <span class= "style3 ">
<script language=javascript src=http://www.fsfjst.com/inc/birthday.js> </script>
从
<input name= "time1 " type= "text " id= "time12 " size= "15 " readonly= "true " onMouseOver= "show_cele_date(this, ' ', ' ',this) ">
到
<input name= "time2 " type= "text " id= "time22 " size= "15 " readonly= "true " onMouseOver= "show_cele_date(this, ' ', ' ',this) ">
</span> </span> </td>
<td width= "83 "> </td>
</tr>
<tr>
<td height= "64 "> </td>
<td> <div align= "center ">
<input name= "submit " type= "submit " id= "submit " value= "查询 ">
<input name= "submit " type= "reset " id= "submit " value= "重置 ">
</div> </td>
<td> </td>
</tr>
<tr>
<td height= "28 "> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<form name= "form2 " method= "post " action= " ">
<table width= "944 " height= "31 " border= "1 " align= "center ">
<tr bordercolor= "#0066CC " bgcolor= "#00CCCC ">
<td width= "143 "> 订单号 </td>
<td width= "98 "> 顾客 </td>
<td width= "133 "> 填单时间 </td>
<td width= "139 "> 填单人 </td>
<td width= "120 "> 总金额 </td>
<td width= "127 "> 备注 </td>
<td width= "154 "> 操作 </td>
<%
if(type!=null)
{
if(type.equals( "查询 "))
{ int index=1;
fisttime=request.getParameter( "time1 ");
lasttime=request.getParameter( "time2 ");
String cha= "select OrderBillNo,ClientId,BillDate,Operator,Amount,Memo from O_SOrder where BillDate> = '? ' and BillDate <= '? ' and IsChecked=0 ";
String [] par3={fisttime,lasttime};
check.setQuerystatement(cha);
check.setParam(par3);
rs=check.query();
if(rs==null)
{ %>
<% }
else {
while(rs.next())
{ %>
<tr>
<%for (index=1;index <=6;index++)
{%>
<td align= "center "> <%=rs.getString(index)%> </td>
<%}%>
</form>
<form name= "form3 " action= "ddcheck.jsp " method= "post ">
<td align= "center ">
<input name= "submit1 " type= "button " value= "查询订单 " onClick= "window.location= 'ddetail.jsp?detailid= <%=rs.getString(1)%> ' " >
<input name= "submit " type= "submit " value= "通过 " >
<input name= "submit " type= "submit " value= "拒绝 " >
</td>
</tr>
<input name= "detailid " type= "hidden " value= " <%=rs.getString(1)%> ">
</form>
<%
}
rs.close();
}
}
}
%>
</tr>
</table>
</body>
</html>
[解决办法]
是不是脚本写错了,好好检查下
[解决办法]
有没有把JS和样式引进来啊
[解决办法]
show_cele_date函数的定义在哪里?