日期:2014-05-20 浏览次数:20666 次
<body> <center> <s:form method ="post" name="viewSaleForm" id="viewSaleForm"> <table cellpadding="3" cellspacing="0" border="0" > <tr> <td> <s:textfield name="startTime" label="开始日期" id="startTime" onfocus="HS_setDate(this)"/> </td> </tr> <tr> <td> <s:textfield name="endTime" label="结束日期" id="endTime" onfocus="HS_setDate(this)"/> </td> </tr> <tr> <tr> <td align="center" colspan="2"> <br> <input type="button" value="查询" onclick="querySale()"/> </td> </tr> </table> </s:form> </center> </body> function querySale(){ var startTime=document.getElementById("statTime").value; var endTime=document.getElementById("endTime").value; if(startTime==""||endTime=="") alert("请输入开始时间与结束时间"); else{ document.viewSaleForm.action="ViewSaleHanlder.action"; document.viewSaleForm.method="post"; document.viewSaleForm.submit(); } } 错误: 缺少对象 为什么会提示缺少对象呢?? var startTime=document.getElementById("statTime").value; 这一行 }