盗墓笔记2016百度云:提交信息的时候,向数据库中写入相同的数据2次.怎么回事?
来源:百度文库 编辑:中科新闻网 时间:2024/07/08 09:37:09
重复提交信息,不知道为什么?
<!--#include file="conn.asp"-->
<html>
<head>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.addmsg.title.value)) {
document.addmsg.title.focus();
alert("标题不能为空!");
return false;
}
if(checkspace(document.addmsg.sex.value)) {
document.addmsg.sex.focus();
alert("你没有选择性别!");
return false;
}
if(checkspace(document.addmsg.relation.value)) {
document.addmsg.relation.focus();
alert("关系项你还没选哦!");
return false;
}
if(checkspace(document.addmsg.name.value)) {
document.addmsg.name.focus();
alert("名字要写上!");
return false;
}
if(checkspace(document.addmsg.content.value)) {
document.addmsg.content.focus();
alert("内容你还没写呢!");
return false;
}
if(checkspace(document.addmsg.email.value)) {
document.addmsg.email.focus();
alert("如果你没有E-MAIL,随便填一个也行。-_-");
return false;
}
document.addmsg.submit();
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>签写留言</title>
</head>
................
<form name="addmsg" method="post" action="addmessage_at.asp">
<input type="hidden" name="POST" value="True">
<table border="0" width="985" cellspacing="0" cellpadding="0">
............
<tr>
<td colspan="4">
<input onClick="return check();" style="border:1pt dotted green;background-color:#ffffff;width=60px" type=submit value="写 好 了">
<input style="border:1pt dotted green;background-color:#ffffff;width=60px" type="reset" value="重 新 写" name="重置">
</td>
</tr>
我知道哪里错了.把type=submit改成type=button就可以了
<!--#include file="conn.asp"-->
<html>
<head>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.addmsg.title.value)) {
document.addmsg.title.focus();
alert("标题不能为空!");
return false;
}
if(checkspace(document.addmsg.sex.value)) {
document.addmsg.sex.focus();
alert("你没有选择性别!");
return false;
}
if(checkspace(document.addmsg.relation.value)) {
document.addmsg.relation.focus();
alert("关系项你还没选哦!");
return false;
}
if(checkspace(document.addmsg.name.value)) {
document.addmsg.name.focus();
alert("名字要写上!");
return false;
}
if(checkspace(document.addmsg.content.value)) {
document.addmsg.content.focus();
alert("内容你还没写呢!");
return false;
}
if(checkspace(document.addmsg.email.value)) {
document.addmsg.email.focus();
alert("如果你没有E-MAIL,随便填一个也行。-_-");
return false;
}
document.addmsg.submit();
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>签写留言</title>
</head>
................
<form name="addmsg" method="post" action="addmessage_at.asp">
<input type="hidden" name="POST" value="True">
<table border="0" width="985" cellspacing="0" cellpadding="0">
............
<tr>
<td colspan="4">
<input onClick="return check();" style="border:1pt dotted green;background-color:#ffffff;width=60px" type=submit value="写 好 了">
<input style="border:1pt dotted green;background-color:#ffffff;width=60px" type="reset" value="重 新 写" name="重置">
</td>
</tr>
我知道哪里错了.把type=submit改成type=button就可以了
对呀,全发过来吧,最好把asp后台代码也发过来
你的表单内容给的不全呀,不知道错在哪里,再写全点。
提交信息的时候,向数据库中写入相同的数据2次.怎么回事?
ASP向数据库(ACCESS)写入数据的时候如何避免冲突?
用ASP向数据库写入数据时出现的错误
用ASP向数据库写入数据时出现的错误
运行写入ACCESS数据库并提交写入信息时,出现INSERT INTO 语句的语法错误,不能把数据写入数据库?
运行写入ACCESS数据库并提交写入信息时,出现INSERT INTO 语句的语法错误,不能把数据写入数据库?
在用insert into 语句向ACCESS数据库添加信息的时候,怎么能够允许在传送的数据中,有可以为空的。
asp-向数据库写入数据时出错
向mdb数据库写入中文数据乱码
asp向数据库写入数据时出错