<%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title></title>
<link rel="stylesheet" href="style/athletic.css">
<script type="text/javascript"> function queryItem() {
itemForm.btnTopPage.disabled = true;
itemForm.btnPreviousPage.disabled = true;
itemForm.btnNext.disabled = true;
itemForm.btnBottomPage.disabled = true; with (document.getElementById("queryForm")) {
method = "post";
action = "querySchoolById.do";
submit();
}
}

function topPage() {
window.self.location = "listSchoolById.do?pageNo=${pageModel.topPageNo}&pageSize=${listSchoolByIdForm.pageSize}"
}

function previousPage() {
window.self.location = "listSchoolById.do?pageNo=${pageModel.previousPageNo}&pageSize=${listSchoolByIdForm.pageSize}"
}

function nextPage() {
window.self.location = "listSchoolById.do?pageNo=${pageModel.nextPageNo}&pageSize=${listSchoolByIdForm.pageSize}"
}

function bottomPage() {
window.self.location = "listSchoolById.do?pageNo=${pageModel.bottomPageNo}&pageSize=${listSchoolByIdForm.pageSize}"
}

function myOnkeypress() {
if (window.event.keyCode == 13) {
queryItem();
}
}

</script>
</head><body  class="body1">
<form name="queryForm" id="queryForm">
  <div align="center">
    <table width="95%" border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
    <table width="95%" border="0" cellspacing="0" cellpadding="0" height="8">
      <tr>
        <td width="522" class="p1" height="2" nowrap><img src="images/_arrow_02.gif" width="14" height="14">&nbsp;<b>学校&gt;&gt;项目&gt;&gt;信息</b></td>
      </tr>
    </table>
    <hr width="97%" align="center" size=0>
    <table width="95%" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td width="17%" height="29"> <div align="left">学校/编号:</div></td>
        <td width="46%"><input name="queryId" type="text"  class="text1" id="queryId" value="请输入所要查询的学校编号" size="50" maxlength="50" onkeypress="myOnkeypress()"> 
        </td>
        <td width="37%"> <div align="left"> 
            <input name="btnQuery" type="button" class="button1" id="btnQuery"  value="查询" onClick="queryItem()">
        </div></td>
      </tr>
      <tr> 
        <td height="16"> 
          <div align="right"></div></td>
        <td>&nbsp; </td>
        <td><div align="right"></div></td>
      </tr>
    </table>
    
  </div>
  </form>
  <form name="itemForm" id="itemForm">
  <table width="95%" border="0" cellspacing="0" cellpadding="0"  class="rd1" align="center">
    <tr> 
      <td nowrap height="10" class="p2">得分信息</td>
      <td nowrap  height="10" class="p3">&nbsp;</td>
    </tr>
  </table>
  <table width="95%" border="1" cellspacing="0" cellpadding="0" align="center" class="table1">
    <tr>       <td width="170" class="rd6">编号</td>
      <td width="222" class="rd6">学校名字</td>
      <td width="195" class="rd6">总积分</td>
    </tr>
    <c:forEach items="${pageModel.list}" var="school">
    <tr> 
      <td width="293" class="rd8" >${school.id }</td>
      <td width="293" class="rd8" >${school.name }</td>
      <td width="293" class="rd8" >${school.totleScore }</td>
    </tr>
    </c:forEach>
  </table>
  <table width="95%" height="30" border="0" align="center" cellpadding="0" cellspacing="0" class="rd1">
    <tr> 
      <td class="rd19" height="2" width="36%"> <div align="left"><font color="#FFFFFF">&nbsp;信息:&nbsp;</font><font color="red">列表</font>
        </div></td>
      <td class="rd19" width="64%"> <div align="right">
        <input name="btnTopPage" class="button1" type="button" id="btnTopPage" value="|&lt;&lt; "  title="首页" onClick="topPage()">
        <input name="btnPreviousPage" class="button1" type="button" id="btnPreviousPage" value=" &lt;  "  title="前一页" onClick="previousPage()">
        <input name="btnNext" class="button1" type="button" id="btnNext" value="  &gt; "  title="后一页" onClick="nextPage()">
        <input name="btnBottomPage" class="button1" type="button" id="btnBottomPage" value=" &gt;&gt;|"  title="尾页" onClick="bottomPage()">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>我想实现再点查询的时候把下面的上一页下一页首页尾页的按钮失效,可是总事业不成功,哪位能给看一下哪里错了3q

解决方案 »

  1.   

    看错了,不好意思
    try:
    itemForm===》document.itemForm
      

  2.   

    刚刚试了下LZ的代码,在IE6下正常,能够让按钮失效推测原因:可能页面刷新,LZ认为JS未生效
    具体查看方法:function queryItem() {
            itemForm.btnTopPage.disabled = true;
            itemForm.btnPreviousPage.disabled = true;
            itemForm.btnNext.disabled = true;
            itemForm.btnBottomPage.disabled = true;
            alert("这个时候看看按钮是否已经失效");
            with (document.getElementById("queryForm")) {
                method = "post";
                action = "querySchoolById.do";
                submit();
            }
        }
      

  3.   

    js生效了,在函数queryItem用alert(itemForm.butnTopPage.value)还可以取道它的值,但是就是失效不起作用
      

  4.   

    alert("这个时候看看按钮是否已经失效");// 这句的时候,按钮变灰了没有,变灰了就失效了
    不清楚LZ的试销是个什么概念。。
      

  5.   

    取表单的时候使用document.formName,这样是所有浏览器都支持的。
      

  6.   

    点查询按钮时,你是不想要分页吧!
    那你就在查询的action中传出来一个标志,如:flag;在页面中加载时加入onload="nodispage()"
    判断flag标志为true就执行它.
    function nodispage() {
            itemForm.btnTopPage.disabled = true;
            itemForm.btnPreviousPage.disabled = true;
            itemForm.btnNext.disabled = true;
            itemForm.btnBottomPage.disabled = true;
    }
      

  7.   

    不错,我开始的时候在查询表单中放一个隐藏域,然后在上一页。。按钮中用三目运算符来判断的  <%="hiddenValue".equals(request.getParameter("hiddenName")) ? "disabled" : ""%>功能是实现了,可是我想jsp页面中不出现java代码的,这主要问题是在页面onload的时候怎样拿到这个flag的值,我用el老是出错,可能是我没有写正确吧能否再赐教一下