页面内的所有按钮都变成了提交,请问有遇到这种情况的么?
我写了一个简单的文章提交的页面,页面中有几个按钮,本来是正常运行的,后来不知道改了什么,结果页面内的其他按钮都变成提交了,就是说不管点击页面的哪个按钮,都会提交。麻烦各位大侠看看到底是什么地方出现了问题啊。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!--#include file="adminconn.inc" -->
<!--#include file="yanzheng.asp"-->
<%
dim rs
dim sql
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from bigClass order by bigClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("bigClassid"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("bigClassid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
</script>
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK href="images/style.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.6082" name=GENERATOR>
<base target="right">
</HEAD>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width=800 align=left border=0>
<TBODY>
<TR>
<TD width=10></TD>
<TD width=790>
<TABLE cellSpacing=0 cellPadding=0 width=1107 align=center border=0>
<TBODY>
<TR>
<TD class=14 align=middle width=92
background=images/right_top.png
height=24><STRONG>管理首页</STRONG></TD>
<TD width=1015 background=images/right_topbg.png
bgColor=#ffffff></TD></TR></TBODY></TABLE>
<TABLE class=bian cellSpacing=0 cellPadding=0 width=1118 align=center
border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#f2f7f9 height=480>
<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center
border=0>
<TBODY>
<TR>
<TD height=10></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=1 width="95%" align=center
bgColor=#c2dbe7 border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#f2f7f9 height=54>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<form name="addNEWS" method="post" action="addinfo_ok.asp" onSubmit="return CheckForm();">
<TBODY>
<TR>
<TD class=bai align=middle bgColor=#cae5f7
height=24>文章添加</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=4 width="100%"
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD align=right width="16%" bgColor=#eef7fd
height=12>文章标题:</TD>
<TD align=left bgColor=#eef7fd><input name="title" type="text" class="input" size="30">
<font color="#FF0000">注意:标题中不能含有“”(引号),否则在首页上对应的栏目将不显示。</font></TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=26> 文章来源:</TD>
<TD align=left bgColor=#eef7fd><input name="url" type="text" class="input" size="30"> <BUTTON
title=网站站长 onclick="url.value='本站原创'">本站原创</BUTTON> </TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=26 rowspan="2">文章类别:</TD>
<TD align=left bgColor=#eef7fd><select name="bigclass" onchange="document.getElementById('bigclassid').value=this.options[this.selectedIndex].bigclassid;document.getElementById('bigclassname').value=this.options[this.selectedIndex].bigclassname; ">
<option value="" bigclassid="" admin="">选择类别</option>
<%
set rs=conn.execute("select bigclassname,bigclassid,bigclassname from bigclass")
do while not rs.eof
Response.Write " <option value='"&rs(0)&"' bigclassid='"&rs(1)&"' bigclassname='"&rs(2)&"' > "&rs(0)&" </option> "
rs.movenext
loop
rs.close
%>
</select>
对应的id: <input name="bigclassid" id="bigclassid" type="text" >
类别名称: <input name="bigclassname" id="bigclassname" type="text" >
</TD></TR>
<TR>
<TD align=left bgColor=#eef7fd>文章内容:<font color="#FF0000">说明:如果
文章过长,可以在编辑器中加入[NextPage]进行分页 </font><SPAN class=b1_1> <INPUT onclick="eWebEditor.insertHTML('[NextPage]')" type=button value=插入分页符></SPAN></TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=350> </TD>
<TD align=left bgColor=#eef7fd>
<IFRAME ID="eWebEditor" SRC="../../../../Editor/ewebeditor.htm?id=cnWords&style=laoy" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="350" name="I2"></IFRAME></TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=6>
<font color="#FF0000"> </font>发布人:</TD>
<TD align=left bgColor=#eef7fd><input name="user" type="text" class="input" value="admin" size="30">
<BUTTON onclick="user.value='未知'">未知</BUTTON> <BUTTON
onclick="user.value='admin'">admin</BUTTON> </TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=5>图片地址:</TD>
<TD align=left bgColor=#eef7fd><input name="picurl" type="text" class="input" size="30" >
<BUTTON title=网站站长 onclick=" picurl.value=''">清空数据</BUTTON> </TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=5>本地上传:</TD>
<TD align=left bgColor=#eef7fd>
<iframe border="0" frameBorder="0" frameSpacing="0" height="23" marginHeight="0" marginWidth="1" noResize scrolling="no" width="55%" vspale="0" src="../../../Upload.asp" name="I3"></iframe></TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=5>图片文章:</TD>
<TD align=left bgColor=#eef7fd><input name="picwen" type="text" class="input" size="9" value="0" readonly>
<BUTTON
title=网站站长 onclick="picwen.value='1'">图片文章</BUTTON> <BUTTON
onclick="picwen.value='0'">非图文</BUTTON>
<font color="#FF0000">有图片地址才可选“图片文章”,1为图片文章,0为非图文</font></TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=5> </TD>
<TD align=left bgColor=#eef7fd> </TD></TR>
<TR>
<TD align=right bgColor=#eef7fd height=26></TD>
<TD align=left bgColor=#eef7fd>
<input type="submit" name="Submit" value="提交" class="input">
<input type="reset" name="Submit2" value="重置" class="input">
<!--获取EditBox的内容-->
<input name=cnWords type=hidden ID="cnWords" value=""> <input name=imageNum type=hidden ID="imageNum" value="<%=mImageNum%>">
<input name=editFirstImageName type=hidden ID="editFirstImageName" value="">
<!--获取EditBox的内容--></TD></TR></TBODY></form></TABLE></TD></TR></TBODY></TABLE>
<p> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<script language=javascript>
function CheckForm()
{
if(document.addNEWS.title.value=="")
{
alert("标题没有写");
document.addNEWS.title.focus();
return false;
}
if(document.addNEWS.url.value=="")
{
alert("文章来源没有填写");
document.addNEWS.url.focus();
return false;
}
}
</script>
</BODY></HTML>
分享到:
[解决办法]
<BUTTON onclick="user.value='未知'">未知</BUTTON>
改成:;<BUTTON style=button onclick="user.value='未知'">未知</BUTTON>