-- 作者:lzr850825
-- 发布时间:5/11/2009 2:53:00 PM
-- [求助] 表单查询执行不了
search.htm <html> <head> <title>软件维护文档历史检索</title> <style type="text/css"> <!-- .formset{border:1px solid #000000;} --> </style> </head> <body> <xml id="dsoSearch" src="../xml/records.xml"></xml> <center><div class="formset" style="width:600px;margin:0px auto;"> <div align="center"><b><font size="5">软件维护文档历史检索</font></b></div> <div align="right"><a href="../index.htm"><font size="2">[返回首页]</font></a> </div> <hr> <div align="left"> <font size="3">请输入你想查询的维护记录时间:</font> <input type="text" id="searchText" value="格式:2009-3-12" onblur="if (this.value==''){ this.value='格式:2009-3-12';this.style.color='#999';} else{this.style.color='';}" onfocus="if (this.value=='格式:2009-3-12'){this.value='';this.style.color='';}" title="单击此处输入查询时间 " style="width:150px; color:#999"/> <input type="button" value="检索" onclick="findlist()"/><br> </div> <hr> 查询结果: <table id="resultDiv" border="1" class="formset"> <thead> <th>编号</th> <th>软件名称</th> <th>问题记录</th> <th>实现期限</th> <th>预估成本</th> <th>维护人员</th> <th>维护时间</th> </thead> <script language="javascript"> function findlist() { var searchString=searchText.value; if(searchString==""){ alert("请输入查询的维护记录时间"); return; } dsoSearch.recordset.moveFirst(); var result=""; while(!dsoSearch.recordset.eof) { dateString=dsoSearch.recordset("date").value; if(dateString==searchString) result+= "<tr>" +"<td>"+dsoSearch.recordset.("id")+"</td>" +"<td>"+dsoSearch.recordset.("title")+"</td>" +"<td>"+dsoSearch.recordset.("question")+"</td>" +"<td>"+dsoSearch.recordset.("finish")+"</td>" +"<td>"+dsoSearch.recordset.("cost")+"</td>" +"<td>"+dsoSearch.recordset.("member")+"</td>" +"<td>"+dsoSearch.recordset.("date")+"</td>" +"</tr>" dsoSearch.recordset.moveNext(); } if(result=="") alert("系统找不到指定日期的历史维护记录"); else resultDiv.innerHTML=result; } </script> </table> </div> </center> </body> </html> records.xml <?xml version="1.0" encoding="gb2312"?> <sheets> <sheet id="001"> <title>图书管理系统</title> <question>无法查询</question> <finish>7天</finish> <cost>/</cost> <member>张斌</member> <date>2009-4-17</date> </sheet> <sheet id="002"> <title>智能楼宇管理系统</title> <question>月帐户数据读取错误</question> <finish>5天</finish> <cost>2000</cost> <member>王珊</member> <date>2009-4-18</date> </sheet> <sheet id="003"> <title>学生选课系统</title> <question>添加新增课程失败</question> <finish>10天</finish> <cost>/</cost> <member>李莉</member> <date>2009-4-19</date> </sheet> </sheets> 点击“检索”按钮,无法执行,不知道什么原因,望指点一二~~
|