回 帖 发 新 帖 刷新版面

主题:[原创]为什么的select下拉框中的onchange事件没有反应呢?请高手指点

代码是我自己写的,做就不能形成联动,不知道是不是我调用的onchange事件不成功,请高手帮帮忙,我已经自己研究了好几天,但还是不成功,我不想用数组,也不想连接数据库,如果用我的思想不能成功,请大虾们指点指点,小弟在些先谢了,我写的代码如下:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发表文章</title>
</head>

<body>
<script language="javascript" type="text/javascript"> 
  function change_lanmu() 
  { 
          document.form1.lanmu.options.length = 0;
          if (bankuai=="班级动态")
          document.form1.lanmu.options[0] = new Option('选择栏目','0'); 
          document.form1.lanmu.options[1] = new Option('就业信息','1'); 
          document.form1.lanmu.options[2] = new Option('工作信息','2'); 
          document.form1.lanmu.options[3] = new Option('其它信息','3'); 
          else if (bankuai=="班级资料") 
          document.form1.lanmu.options[0] = new Option('选择栏目','0'); 
          document.form1.lanmu.options[1] = new Option('学习资料','1'); 
          document.form1.lanmu.options[2] = new Option('工作资料','2'); 
          document.form1.lanmu.options[3] = new Option('其它资料','3');
          document.form1.lanmu.options[4] = new Option('资料下载','4');
          else if (bankuai=="班级作品") 
          document.form1.lanmu.options[0] = new Option('选择栏目','0'); 
          document.form1.lanmu.options[1] = new Option('文学作品','1'); 
          document.form1.lanmu.options[2] = new Option('设计作品','2'); 
          document.form1.lanmu.options[3] = new Option('其它作品','3');
          document.form1.lanmu.options[4] = new Option('灌水区','4');
          else if (bankuai=="班级娱乐")
          document.form1.lanmu.options[0] = new Option('选择栏目','0'); 
          document.form1.lanmu.options[1] = new Option('音乐欣赏','1'); 
          document.form1.lanmu.options[2] = new Option('影视短片','2'); 
          document.form1.lanmu.options[3] = new Option('幽默笑话','3');
          else 
           document.form1.lanmu.options[0] = new Option('选择栏目','0');
  } 
</script>
<table width="560" height="630" border="0" align="center" cellpadding="0" cellspacing="0"><form>
  <tr>
    <td height="30"><table width="560" height="30" border="1" cellpadding="0" cellspacing="0" bgcolor="#FFCCCC">
      <tr>
        <td width="190">来源:<input name="form1" type="text" id="form1" value="原创" size="16" maxlength="16"></td>
        <td width="183"><select name="bankuai" size="1" id="bankuai" onChange="change_lanmu()"> 
          <option value="选择版块">选择版块</option>
          <option value="班级动态">班级动态</option>
          <option value="班级作品">班级作品</option>
          <option value="班级资料">班级资料</option>
          <option value="班级娱乐">班级娱乐</option>
        </select> </td>
        <td width="187"><select name="lanmu" size="1" id="lanmu">
        <option value="0">选择栏目</option>
        </select></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="570" valign="top"><textarea name="content" cols="78" rows="42"></textarea></td>
  </tr>
  <tr>
    <td height="30"><table width="560" height="30" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCFFCC">
      <tr>
        <td width="245" align="right"><input type="submit" name="Submit" value="发表文章"></td>
        <td width="56" align="center" bgcolor="#FFFFCC">&nbsp; </td>
        <td width="259" align="left"><input type="submit" name="Submit2" value="重置表单"></td>
      </tr>
    </table></td>
  </tr>
</form></table>

</body>
</html>


回复列表 (共1个回复)

沙发

?*x&nbsp;&amp;#22888;?&amp;#38133;&amp;#12483;&amp;@賠朄袴賨y&amp;#23744;獍&nbsp;?y(&amp;#12849;祋[@&amp;#20138;y{tmj1Jv?&amp;#26511;7&amp;#12849;?h旍,?骚`??9袿豝.&amp;#28329

我来回复

您尚未登录,请登录后再回复。点此登录或注册