ASP复选框显示问题:数据库里存放的数据格式为(杯子,椅子),修改时如果让显示出在复选框内并打上构.
1个回答
展开全部
<%ss="," & rs("物品") & ","%>
<input name=aaa type=checkbox value="杯子"<%if instr(ss,",杯子,")>0 then response.write " checked"%>>杯子<br>
<input name=aaa type=checkbox value="桌子"<%if instr(ss,",桌子,")>0 then response.write " checked"%>>桌子<br>
<input name=aaa type=checkbox value="椅子"<%if instr(ss,",椅子,")>0 then response.write " checked"%>>椅子<br>
<input name=aaa type=checkbox value="呆子"<%if instr(ss,",呆子,")>0 then response.write " checked"%>>呆子<br>
那个rs("物品")是你数据库中存放的那个字段
<input name=aaa type=checkbox value="杯子"<%if instr(ss,",杯子,")>0 then response.write " checked"%>>杯子<br>
<input name=aaa type=checkbox value="桌子"<%if instr(ss,",桌子,")>0 then response.write " checked"%>>桌子<br>
<input name=aaa type=checkbox value="椅子"<%if instr(ss,",椅子,")>0 then response.write " checked"%>>椅子<br>
<input name=aaa type=checkbox value="呆子"<%if instr(ss,",呆子,")>0 then response.write " checked"%>>呆子<br>
那个rs("物品")是你数据库中存放的那个字段
追问
Temp1="0 then response.write 'checked'>预包装食品散装食品"
我的代码是这样写的, 按你说的方法加过后不行。
追答
ss=", " & rs("jyxm") & ", "
Temp1="0 then Temp1=Temp1 & " checked"
Temp1=Temp1 & ">预包装食品0 then Temp1=Temp1 & " checked"
Temp1=Temp1 & ">散装食品"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询