| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 544 人关注过本帖
标题:[求助]editForm()函数
取消只看楼主 加入收藏
jeffrey77
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-5-8
收藏
 问题点数:0 回复次数:0 
[求助]editForm()函数
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From customergrade",conn,3,1
Do While Not rs.BOF And Not rs.EOF
strToPrint = strToPrint & " <tr>" & VBCrlf
strToPrint = strToPrint & " <td align=""left"">" & rs("customergrade_name") & "</td>" & VBCrlf
strToPrint = strToPrint & " <td>" & rs("customergrade_value") & "</td>" & VBCrlf
strToPrint = strToPrint & " <td>" & rs("customergrade_num") & "</td>" & VBCrlf
strToPrint = strToPrint & " <td align=""center"">[<a href=""?action=edit&customergrade_name=" & rs("customergrade_name") & """>修改</a>] [<a href=""?action=delete&customergrade_name=" & rs("customergrade_name") & """ onClick=""return confirm('是否确认删除?');"">删除</a>]</td>" & VBCrlf
    strToPrint = strToPrint & "        </tr>" & VBCrlf
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
%>
<%
Dim action
action = Trim(Request("action"))
Select Case action
Case "insert"
Call insertData()
Case "saveEdit"
Call saveEditData()
Case "edit"
Call editForm()
Case "delete"
Call deleteData()
End Select
%>
<%
Sub insertData()
………(略去了)End Sub
Sub saveEditData()
………(略去了)End Sub
Sub editForm()
Dim customergrade_name
customergrade_name = 0
customergrade_name = CInt(ABS(Request("customergrade_name")))
Dim customergrade_value,customergrade_num
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From customergrade Where customergrade_name = " & customergrade_name,conn,3,1
customergrade_name = rs("customergrade_name")
customergrade_value = rs("customergrade_value")
customergrade_num = rs("customergrade_num")
End Sub

Sub deleteData()
………(略去了)
End Sub
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>客户等级</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td valign="bottom" bgcolor="#f1f1f1" height="60"><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td><table cellspacing="0" cellpadding="0" width="132" border="0">
<tr>
<td valign="bottom" width="27">&nbsp;</td>
<td valign="bottom" width="88"><font color="#ff6600"><b>客户等级</b></font></td>
<td valign="bottom" width="17">&nbsp;</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#cccccc" height="1"></td>
</tr>
<tr>
<td align="center"><br />
<link rel="stylesheet" href="/css/gb.css" type="text/css" />
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#4282CE"height="2"></td>
</tr>
<form name=insert action="?action=insert" method=post onSubmit="return check_insert();">
<tr>
<td height="26"><p align="left"><img src="images/flat2.gif" width="15" height="13" align="absmiddle" /> <font color="#1F5BA2">添加新的客户等级: </font></p>
<p align="center"><font color="#1F5BA2">客户等级
<input class="box2" name="customergrade_name" value ="" maxlength="45" size="10" />
&nbsp;
优惠额度
<input class="box2" name="customergrade_value" value="" maxlength="45" size="10" />
&nbsp;
上月成交数量
<input class="box2" name="customergrade_num" value="" maxlength="45" />
&nbsp; &nbsp;
<input type="submit" class="sbutton" name="add" value=" 添加 " />
</font> </p></td>
</tr>
<tr>
<td bgcolor="#4282CE" height="1"></td>
</tr>
</form>
<form name=update action="?action=saveEdit" method=post onSubmit="return check_update();"> <tr>
<td height="26"><p align="left"><img src="images/flat2.gif" width="15" height="13" align="absmiddle" />
<font color="#1F5BA2">修改客户等级资料: </font></p>
<p align="center"><font color="#1F5BA2">
客户等级
<input class=box2 name="customergrade_name" value="<%=customergrade_name %>" maxlength="45" size="10" />
&nbsp;
优惠额度
<input class=box2 name="customergrade_value" value="<%=customergrade_value %>" maxlength="45" size="10" />
&nbsp;
上月成交数量
<input class=box2 name="customergrade_num" value="<%=customergrade_num %>" maxlength="45" />
&nbsp;
&nbsp;
<input type="submit" class="sbutton" name="edit" value=" 编辑 " />
</font> </p></td>
</tr>
</form>
<tr>
<td bgcolor="#4282CE" height="2"></td>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width='22%'><font color="#1F5BA2"><b>客户等级</b></font></td>
<td width='30%'><font color="#1F5BA2"><b>优惠额度</b></font></td>
<td width='25%'><font color="#1F5BA2"><b>上月成交数量</b></font></td>
<td width='23%' align="center"><font color="#1F5BA2"><b>操作</b></font></td>
<% = strToPrint %>
</tr>

</table>
<br />
</td>
</tr>
</table>
</body>
</html>
上面的editForm()不知为什么,没办法在点修改时让相应数据在第2个Form里显示,请帮忙修改一下,谢谢

[此贴子已经被作者于2006-5-8 16:58:38编辑过]

搜索更多相关主题的帖子: editForm PRE 函数 
2006-05-08 16:54
快速回复:[求助]editForm()函数
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016974 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved