我在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>&nbsp;</p>
  <table width="781" height="156" border="0" align="center">
    <tr>
      <td width="75" height="56">&nbsp;</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">&nbsp;</td>
    </tr>
    <tr>
      <td height="64">&nbsp;</td>
      <td><div align="center">
  <input name="submit" type="submit" id="submit" value="查询">
&nbsp;&nbsp;&nbsp;
  <input name="submit" type="reset" id="submit" value="重置">
      </div></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="28">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</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>

解决方案 »

  1.   

    浏览器提示为:Script Error!
      

  2.   

    我查了好久都没有查出,我用的是网上的在线控件:<script language=javascript src=http://www.fsfjst.com/inc/birthday.js></script>
    <input type="text" name="Birthday" onFocus="show_cele_date(this,'','',this)">
      

  3.   

    之前我用了一个调用js文件的日期控件,也是出现了 缺少对象等的报错,最后用了网上的依旧是报这个错。
    如果单独把日期控件拿出来,或者把jsp文件格式改为htm格式后又行,这就很让人疑惑了!
      

  4.   

    show_cele_date函数的定义在哪里?
      

  5.   

    呵呵,虽然没分,我也回答下,估计是编码格式的问题。
    <script language=javascript   src=http://www.fsfjst.com/inc/birthday.js charset=gb2132></script>