📄 color_modi.asp
字号:
<!--#include file="../conn.asp"-->
<%
'----------------读取原来的数据-------
id=trim(request("id"))
set rs=server.createobject("adodb.recordset")
rs.open "select * from ht_color where color_id="&id&"",conn,1,1
if rs.eof then
response.write "该记录不存在,可能已经被删除!"
else
color_name=trim(rs("color_name"))
end if
rs.close
set rs=nothing
'-------------修改数据
if trim(request("ckmodi"))<>"" then
ckadd=douhao(trim(request("ckadd")))
color_name=douhao(trim(request("color_name")))
set rs=conn.execute("select color_name from ht_color where color_name='"&color_name&"'")
if not rs.eof then
response.write "<script>alert('已经存在');</script>"
else
conn.execute "update ht_color set color_name='"&color_name&"' where color_id="&id&""
response.write "<script language='javascript'>window.opener.location.href = window.opener.location.href;window.close();</script>"
end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>基础资料维护--产品颜色</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../inc/body.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="00" marginwidth="0" marginheight="0">
<table width="100%" height="168" border="0" cellspacing="0">
<tr>
<td height="168" class="borderon">
<form action="" method="post" name="ck" id="ck">
<table width="215" height="102" border="0" align="center">
<tr>
<td width="41%" height="24">产品颜色:</td>
<td width="59%"><input name="color_name" type="text" id="color_name" value="<%=color_name%>" size="15" ></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="ckmodi" type="submit" id="ckmodi3" value=" 修改 " onClick="return check()">
<input type="button" name="Submit2" value=" 取消 " onClick="javascript:window.close();">
<input name="id" type="hidden" id="id3" value="<%=trim(request("id"))%>">
<script language="JavaScript">
function check(){
if (document.ck.color_name.value==''){
alert('请输入产品颜色!');
document.ck.color_name.focus();
return false;
history.back();
}
return true;
}
</script>
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -