标题:大虾们帮忙看看,老弟是新手,写了个简单的页面老是出错
只看楼主
bozai
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-23
 问题点数:0 回复次数:3 
大虾们帮忙看看,老弟是新手,写了个简单的页面老是出错
帮我看下下面这段程序有什么错误.共有12个按钮,第一个和最后一个实现翻页功能,使中间按纽的值分别减一和加一.按纽的值只能是1到50
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.
  <title></title>
  <script language="JavaScript" type="text/javascript">
  function change0()
  {
   var objs = document.all["a"];
   var b=objs.length;
    for(i=0;i<b;i++)
   objs[i].value=parseInt(objs[i].value)-10;
    if (parseInt(objs[0].value)=1) document.form[0].buttonp.style.display="none";
   if (parseInt(objs[0].value)=!41) document.form[0].buttonn.style.display="block";
   //for(i=0;i<b;i++)
   //objs[i].value=parseInt(objs[i].value)-10;
  }
  function change1()
  {var objs = document.all["a"];
   var b=objs.length;
    for(i=0;i<b;i++)
   objs[i].value=parseInt(objs[i].value)+10;
   if (parseInt(objs[0].value)!=1) document.form.buttonp.style.display="block";
   if (parseInt(objs[0].value)=41) document.form.buttonn.style.display="none";
  // for(i=0;i<b;i++)
  // objs[i].value=parseInt(objs[i].value)+10;
  }
  </script>
  </head>
<body>
  <form name=form1>
  <input name="buttonp" type="button" value="previous"  style="display:none" onclick="change0()">
  <input name="button1" id="a" type="button" value="1">
  <input name="button1" id="a" type="button" value="2">
  <input name="button1" id="a" type="button" value="3">
  <input name="button1" id="a" type="button" value="4">
  <input name="button1" id="a" type="button" value="5">
  <input name="button1" id="a" type="button" value="6">
  <input name="button1" id="a" type="button" value="7">
  <input name="button1" id="a" type="button" value="8">
  <input name="button1" id="a" type="button" value="9">
  <input name="button1" id="a" type="button" value="10">
  <input name="buttonn" type="button" value="next" onclick="change1()">
  </form>
</body>
</html>
搜索更多相关主题的帖子: 页面 老弟 
2008-10-23 09:12
tidusff12
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2008-5-27
得分:0 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <meta name="generator" content="PSPad editor, www.
  <title></title>
  <script language="JavaScript" type="text/javascript">
  function change0()
  {
    var objs = document.all["a"];
    var b=objs.length;
    for(i=0;i<b;i++)
    objs[i].value=parseInt(objs[i].value)-10;
    if (parseInt(objs[0].value) == 1) document.getElementById("buttonp").style.display="none";
    if (parseInt(objs[0].value) != 41) document.getElementById("buttonn").style.display="block";
   //for(i=0;i<b;i++)
   //objs[i].value=parseInt(objs[i].value)-10;
  }
  function change1()
  {
    var objs = document.all["a"];
    var b=objs.length;
   //alert(b);
    for(i=0;i<b;i++)
    objs[i].value=parseInt(objs[i].value)+10;
    if (parseInt(objs[0].value) != 1) document.getElementById("buttonp").style.display="block";
    if (parseInt(objs[0].value) == 41) document.getElementById("buttonn").style.display="none";
  // for(i=0;i<b;i++)
  // objs[i].value=parseInt(objs[i].value)+10;
  }
  </script>
  </head>
<body>
  <form name="form1">
  <input id="buttonp" name="buttonp" type="button" value="previous"  style="display:none" onclick="change0()">
  <input name="button1" id="a" type="button" value="1">
  <input name="button1" id="a" type="button" value="2">
  <input name="button1" id="a" type="button" value="3">
  <input name="button1" id="a" type="button" value="4">
  <input name="button1" id="a" type="button" value="5">
  <input name="button1" id="a" type="button" value="6">
  <input name="button1" id="a" type="button" value="7">
  <input name="button1" id="a" type="button" value="8">
  <input name="button1" id="a" type="button" value="9">
  <input name="button1" id="a" type="button" value="10">
  <input id= "buttonn" name="buttonn" type="button" value="next" onclick="change1()">
  </form>
</body>
</html>
2008-10-23 11:45
bozai
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-23
得分:0 
万分感谢,现在问题解决了
2008-10-23 15:50
bozai
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-10-23
得分:0 
只是我那样写为什么不行
2008-10-23 15:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-240020-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091919 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved