在线急等 asp判断单选按钮选中
现在有这么一段语句<%id=request("id")group_id=request("group_id")sql="select*fromadmintablewher...
现在有这么一段语句
<%
id=request("id")
group_id=request("group_id")
sql = "select * from admintable where id="&request("id")
set rs = conn.Execute(sql)
%>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" class="tbl1o1">
<form method="post" name="myform" action="?action=SaveEditMight">
<tr>
<td height="25" align="center" valign="middle" class="td1"><span class="STYLE15">编辑管理员</span><span class="STYLE2">〖<span class="STYLE15"><%=rs("name")%></span>〗</span><span class="STYLE15">权限</span></td>
</tr>
<tr>
<td height="25" class="td1o1">
<span class="STYLE6">说明:超级管理员可以越过所有权限。请慎重分配好每个管理员的权限。</span><br>
<span class="STYLE2">
<input name="chkAll2" type="checkbox" id="chkAll" onClick=SelectAll(this.form) value="checkbox" >
选择所有权限
<%
sqlh = "select id,groupname from admin_group order by border desc"
set rsh = conn.Execute(sqlh)
if not (rsh.bof and rsh.eof) then
do while not rsh.eof
%>
<input name="checkgroup" type="radio" value="<%=rsh("id")%>" onclick="location.href='manageadmin.asp?action=Edit_Might&id=<%=request("id")%>&group_id=<%=rsh("id")%>'" <%if rsh("id")=request("group_id") then response.write "checked" %> >
<%=rsh("groupname")%>
<%
rsh.movenext
loop
end if
rsh.close
set rsh=nothing
%>
</span>
调试了很久,单选按钮就是不选中指定的项目,请高手帮帮忙,万分感谢
本人在线急等
如果解决了,重分感谢!! 展开
<%
id=request("id")
group_id=request("group_id")
sql = "select * from admintable where id="&request("id")
set rs = conn.Execute(sql)
%>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" class="tbl1o1">
<form method="post" name="myform" action="?action=SaveEditMight">
<tr>
<td height="25" align="center" valign="middle" class="td1"><span class="STYLE15">编辑管理员</span><span class="STYLE2">〖<span class="STYLE15"><%=rs("name")%></span>〗</span><span class="STYLE15">权限</span></td>
</tr>
<tr>
<td height="25" class="td1o1">
<span class="STYLE6">说明:超级管理员可以越过所有权限。请慎重分配好每个管理员的权限。</span><br>
<span class="STYLE2">
<input name="chkAll2" type="checkbox" id="chkAll" onClick=SelectAll(this.form) value="checkbox" >
选择所有权限
<%
sqlh = "select id,groupname from admin_group order by border desc"
set rsh = conn.Execute(sqlh)
if not (rsh.bof and rsh.eof) then
do while not rsh.eof
%>
<input name="checkgroup" type="radio" value="<%=rsh("id")%>" onclick="location.href='manageadmin.asp?action=Edit_Might&id=<%=request("id")%>&group_id=<%=rsh("id")%>'" <%if rsh("id")=request("group_id") then response.write "checked" %> >
<%=rsh("groupname")%>
<%
rsh.movenext
loop
end if
rsh.close
set rsh=nothing
%>
</span>
调试了很久,单选按钮就是不选中指定的项目,请高手帮帮忙,万分感谢
本人在线急等
如果解决了,重分感谢!! 展开
4个回答
展开全部
<%
id=request("id")
group_id=request("group_id")
sql = "select * from admintable where id="&request("id")
set rs = conn.Execute(sql)
%>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" class="tbl1o1">
<form method="post" name="myform" action="?action=SaveEditMight">
<tr>
<td height="25" align="center" valign="middle" class="td1"><span class="STYLE15">编辑管理员</span><span class="STYLE2">〖<span class="STYLE15"><%=rs("name")%></span>〗</span><span class="STYLE15">权限</span></td>
</tr>
<tr>
<td height="25" class="td1o1">
<span class="STYLE6">说明:超级管理员可以越过所有权限。请慎重分配好每个管理员的权限。</span><br>
<span class="STYLE2">
<input name="chkAll2" type="checkbox" id="chkAll" onClick=SelectAll(this.form) value="checkbox" >
选择所有权限
<%
if group_id<>"" then
sqlhh = "select id,Might from admin_group where id="&group_id&""
set rshh = conn.Execute(sqlhh)
Might=rshh("Might")
g_id=rshh("id")
rshh.close
set rshh=nothing
else
Might=rs("Might")
g_id=rs("GroupID")
end if
%>
<%
sqlh = "select id,groupname from admin_group order by border desc"
set rsh = conn.Execute(sqlh)
if not (rsh.bof and rsh.eof) then
do while not rsh.eof
%>
<input name="checkgroup" type="radio" value="<%=rsh("id")%>" onmouseover="location.href='manageadmin.asp?action=Edit_Might&id=<%=request("id")%>&group_id=<%=rsh("id")%>'" <%if rsh("id")=g_id then response.write "checked" %> >
<%=rsh("groupname")%>
<%
rsh.movenext
loop
end if
rsh.close
set rsh=nothing
%>
</span>
</td>
</tr>
<tr>
<td height="25" class="td1o1">
<span class="STYLE21">
<%
n = 0
for i=0 to ubound(MightList,1)
Response.Write "<br><br><b><font color='red'>"&MightList(i,0)&"</font></b><br>"
for j=1 to ubound(MightList,2)
if isempty(MightList(i,j)) then exit for
tmpmenu=split(MightList(i,j),"@@")
menuname=tmpmenu(0)
menurl=tmpmenu(1)
n = n+1
%>
<input type="checkbox" name="Might" id="Might" value="<%=menurl%>" <% if instr(","& Might &",",","& menurl &",")>0 then response.write "checked" %>><%=menurl%>. <%=menuname%>
<%
next
%>
<%next%>
</span>
id=request("id")
group_id=request("group_id")
sql = "select * from admintable where id="&request("id")
set rs = conn.Execute(sql)
%>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" class="tbl1o1">
<form method="post" name="myform" action="?action=SaveEditMight">
<tr>
<td height="25" align="center" valign="middle" class="td1"><span class="STYLE15">编辑管理员</span><span class="STYLE2">〖<span class="STYLE15"><%=rs("name")%></span>〗</span><span class="STYLE15">权限</span></td>
</tr>
<tr>
<td height="25" class="td1o1">
<span class="STYLE6">说明:超级管理员可以越过所有权限。请慎重分配好每个管理员的权限。</span><br>
<span class="STYLE2">
<input name="chkAll2" type="checkbox" id="chkAll" onClick=SelectAll(this.form) value="checkbox" >
选择所有权限
<%
if group_id<>"" then
sqlhh = "select id,Might from admin_group where id="&group_id&""
set rshh = conn.Execute(sqlhh)
Might=rshh("Might")
g_id=rshh("id")
rshh.close
set rshh=nothing
else
Might=rs("Might")
g_id=rs("GroupID")
end if
%>
<%
sqlh = "select id,groupname from admin_group order by border desc"
set rsh = conn.Execute(sqlh)
if not (rsh.bof and rsh.eof) then
do while not rsh.eof
%>
<input name="checkgroup" type="radio" value="<%=rsh("id")%>" onmouseover="location.href='manageadmin.asp?action=Edit_Might&id=<%=request("id")%>&group_id=<%=rsh("id")%>'" <%if rsh("id")=g_id then response.write "checked" %> >
<%=rsh("groupname")%>
<%
rsh.movenext
loop
end if
rsh.close
set rsh=nothing
%>
</span>
</td>
</tr>
<tr>
<td height="25" class="td1o1">
<span class="STYLE21">
<%
n = 0
for i=0 to ubound(MightList,1)
Response.Write "<br><br><b><font color='red'>"&MightList(i,0)&"</font></b><br>"
for j=1 to ubound(MightList,2)
if isempty(MightList(i,j)) then exit for
tmpmenu=split(MightList(i,j),"@@")
menuname=tmpmenu(0)
menurl=tmpmenu(1)
n = n+1
%>
<input type="checkbox" name="Might" id="Might" value="<%=menurl%>" <% if instr(","& Might &",",","& menurl &",")>0 then response.write "checked" %>><%=menurl%>. <%=menuname%>
<%
next
%>
<%next%>
</span>
参考资料: http://www.tootv.cn/index.asp
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%if rsh("id")=request("group_id") then response.write "checked" %>
中request("group_id") 是什么应该改位group_id
中request("group_id") 是什么应该改位group_id
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
从数据库中id是不是数字啊,
cstr(rsh("id"))=request("group_id")
cstr(rsh("id"))=request("group_id")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
有点看不懂哦.
怎么一会type="checkbox"
一会又是type="radio"的.
解释一下?
怎么一会type="checkbox"
一会又是type="radio"的.
解释一下?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询