实现效果,类似dotnet中GridView中的编辑的效果!
简化后全部的 asp 代码:
<
%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../public/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" c />
<title>无标题文档</title>
<script language="javascript">
function showtr()
{
alert(document.activeElement.value);
if (document.getElementById("showmanage").style.display=="block")
{
document.getElementById("showmanage").style.display="none";
}
else
{
document.getElementById("showmanage").style.display="block";
}
if (document.getElementById("nonetable").style.display=="block")
{
document.getElementById("nonetable").style.display="none";
}
else
{
document.getElementById("nonetable").style.display="block";
}
}
</script>
<%
sql="select * from [user]"
rs.open sql,conn,1,3
%>
</head>
<body>
<table border="0">
<tr>
<td><table border="0">
<tr>
<td class="STYLE6">用户名</td>
<td class="STYLE6">管理员操作</td>
</tr>
<%
while not rs.eof
%>
<tr id="showmanage" style="display:block;">
<td class="STYLE6"><%=rs("user_name")%></td>
<td class="STYLE6">
<input type="button" name="Submit22" value="编辑" />
<input type="submit" name="Submit2" value="删除" />
</td>
</tr>
<tr id="nonetable" style="display:none;">
<td class="STYLE6"><input name="username2" type="text" value="<%=rs("user_name")%>" size="10"/></td>
<td class="STYLE6">
<input type="submit" name="Syes" value="确认" />
<input type="button" name="cancel" value="取消" />
</td>
</tr>
<%
rs.MoveNext
wend
%>
</table>
</td>
</tr>
</table>
</body>
</html>
这个实现的效果是第一行可以编辑,点击其他行都只能对第一行进行编辑,我知道原因了是我获取的name的问题,但是,不知道如何解决!
希望各位大哥大姐们帮帮忙!