有三个单选框,如何看到从数据库中读取的值是哪个单选框被选选中了

xuallen 2003-08-23 08:40:59
总提示第3行有错误,怎么回事呢?
<% select case rs1("UserIdentify") %>
<% case "音乐" %>
<% 1checked="checked" %>
<% case "电影" %>
<% 2checked="checked"%>
<% case "其他" %>
<% 3checked="checked"%>
<% end select %>
<td width="36%" height="9">
<input type="radio" value="音乐" name="UserIdentify" <%=1checked%>>音乐
<input type="radio" name="UserIdentify" value="电影" <%=2checked%>>电影
<input type="radio" name="UserIdentify" value="其他" <%=3checked%>>其他</td>
<%1checked=""%>
<%2checked=""%>
<%3checked=""%>
...全文
85 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cloudchen 2003-08-24
  • 打赏
  • 举报
回复
用js,那样判断实在是太浪费服务器端资源了
<script>
document.formName.checkboxname[i].checked = true;
</script>
zscjp 2003-08-24
  • 打赏
  • 举报
回复
我这用类似代码。
<input type="radio" name="ShenPiState" value="a" <%if oldRs("ShenPiState")="a" then response.write "checked" end if %>>
通过
<input type="radio" name="ShenPiState" value="b" <%if oldRs("ShenPiState")="b" then response.write "checked" end if %>>
不通过
<input type="radio" name="ShenPiState" value="c" <%if oldRs("ShenPiState")="c" then response.write "checked" end if %>>
不表态
楚人无衣 2003-08-24
  • 打赏
  • 举报
回复
<input type="radio" value="音乐" name="UserIdentify" <%if rs1("UserIdentify")='音乐' then%> checked <%end if%>>音乐
<input type="radio" name="UserIdentify" value="电影" <%if rs1("UserIdentify")='电影' then%> checked <%end if%>>电影
<input type="radio" name="UserIdentify" value="其他" <%if rs1("UserIdentify")='其他' then%> checked <%end if%>>其他
zorou_fatal 2003-08-23
  • 打赏
  • 举报
回复
<% select case rs1("UserIdentify") %>
<% case "音乐" %>
<% checked1="checked" %>
<% case "电影" %>
<% checked2="checked"%>
<% case "其他" %>
<% checked3="checked"%>
<% end select %>
<td width="36%" height="9">
<input type="radio" value="音乐" name="UserIdentify" <%=checked1%>>音乐
<input type="radio" name="UserIdentify" value="电影" <%=checked2%>>电影
<input type="radio" name="UserIdentify" value="其他" <%=checked3%>>其他</td>
<%checked1=""%>
<%checked2=""%>
<%checked3=""%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧