Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2298391
  • 博文数量: 252
  • 博客积分: 5472
  • 博客等级: 大校
  • 技术积分: 3107
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-17 18:39
文章分类

全部博文(252)

文章存档

2012年(96)

2011年(156)

分类: 系统运维

2011-12-08 10:25:19

  1. <html>
  2.     <head>
  3.         <title>网上书店</title>
  4.         <SCRIPT LANGUAGE="JavaScript">
  5.             
  6.         </SCRIPT>
  7.     </head>
  8.     <body>
  9.         <form name="searchForm" action="" method="post" onClick="fsubmit()">
  10.             <input type="radio" name="rcond" onclick="hideall()">查看所有图书<p>
  11.             
  12.             <input type="radio" name="rcond" onclick="showpre()">精确搜索<p>
  13.             <table id=pre style="DISPLAY: none">
  14.                 <tr>
  15.                     <td>书名:</td>
  16.                     <td><input type="text" name="title"></td>
  17.                 </tr>
  18.                 <tr>
  19.                     <td>作者:</td>
  20.                     <td><input type="text" name="author"></td>
  21.                 </tr>
  22.                 <tr>
  23.                     <td>出版社:</td>
  24.                     <td><input type="text" name="bookconcern"></td>
  25.                 </tr>
  26.             </table><p>
  27.             
  28.             <input type="radio" name="rcond" onclick="showkey()">关键字搜索<p>
  29.             <table id=key style="DISPLAY: none">
  30.                 <tr>
  31.                     <td>请输入关键字:</td>
  32.                     <td><input type="text" name="keyword"></td>
  33.                 </tr>
  34.             </table><p>
  35.             
  36.             <input type="reset" value="重新输入">
  37.             <input type="submit" value="搜索">
  38.         </form>
  39.     </body>
  40. </html>
此页面提供三种不同的查询方式:查看所有图书、精确搜索和关键字走索。
另外,JS脚本代码能够动态显示查询选项。 根据不同的查询选项可以动态显示查询选项
JS中的函数fsubmit()可以来控制不同的查询方式。将参数con传递给servlet。servlet根据不同的con来使用不同的查询方式 。
 
 
阅读(1040) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~