这是整个添加程序段:
<!--#include file="conn.asp"-->
<SCRIPT language=javascript>
function form4_onsubmit()
{
if(document.FORM4.recorder.value.length<1)
{
alert("经手人不能为空!");
document.FORM4.recorder.focus();
return false;
}
if(document.FORM4.content.value.length<1)
{
alert("反馈内容不能为空!");
document.FORM4.content.focus();
return false;
}
}
</SCRIPT>
<%
IF Request.Form("action")="添加" Then
Frecorder=trim(request("recorder"))
Fbacktime=trim(request("backtime"))
Fproduct=trim(request("product"))
Fuser_name=trim(request("user_name"))
Fpeople=trim(request("people"))
Fcontent=trim(request("content"))
Fhandle=trim(request("handle"))
Fresult=trim(request("result"))
set rsF=server.createobject("adodb.recordset")
sqltext="select * from [feedback]"
rsF.open sqltext,conn,3,3
'添加一条记录到数据库
rsF.addnew
rsF("recorder")=Frecorder
rsF("backtime")=Fbacktime
rsF("product")=Fproduct
rsF("user_name")=Fuser_name
rsF("people")=Fpeople
rsF("content")=Fcontent
rsF("handle")=Fhandle
rsF("result")=Fresult
rsF.update
rsF.close
conn.close
response.write "<script language=JavaScript>{window.alert('此信息添加成功!');opener.parent.right.location.href='Feedback.asp';window.close();}</script>"
response.end
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="Styles.css">
<title>添加反馈信息</title>
</head>
<body oncontextmenu=self.event.returnValue=false>
<form method="POST" action="Feedback_Add.asp" name='FORM4' onSubmit="return form4_onsubmit()">
<table border="1" cellpadding="0" width="100%" bordercolorlight="#A8CBF1" bordercolordark="#FFFFFF" cellspacing="0" height="66">
<tr>
<td colspan="2" bgcolor="#A8CBF1" height="30" align="center"><font size=3><b>添加反馈信息</font></b></td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">经手人:</td>
<td width="71%" bgcolor="#E9F4FF">
<input type="text" name="recorder" size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">反馈日期:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="backtime" type="text"size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">相关产品:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="product" type="text"
size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">相关客户:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="user_name" type="text" size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">相关联系人:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="people" type="text"
size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">反馈内容:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="content" type="text" value="" size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">处理人员:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="handle" type="text" value="" size="20">
</td>
</tr>
<tr>
<td width="32%" height="30" bgcolor="#E9F4FF" align="right">处理结果:</td>
<td width="71%" bgcolor="#E9F4FF">
<input name="result" type="text" value="" size="20">
</td>
</tr>
<tr>
<td height="30" bgcolor="#E9F4FF" colspan="2" align="center">
<p align="center"><input class=button1 type="submit" value="添加" name="action">
<INPUT class=button1 onclick=javascript:window.close() type=button value=关闭></p>
</td>
</tr>
</table></form>
</body>
</html>