享受快乐 2008-1-31 13:41
复选框修改显示
<%
'调出数据库中的数据,如:水,电,.......
idlist=trim(rs("cz_ss"))
'function开始
function CheckPurview(AllPurviews,strPurview)
if isNull(AllPurviews) or AllPurviews="" or strPurview="" then
CheckPurview=False
exit function
end if
CheckPurview=False
if instr(AllPurviews,",")>0 then
dim arrPurviews,i
arrPurviews=split(AllPurviews,",")
for i=0 to ubound(arrPurviews)
if trim(arrPurviews(i))=strPurview then
CheckPurview=True
exit for
end if
next
else
if AllPurviews=strPurview then
CheckPurview=True
end if
end if
end function
%>
使用时只要:
<input name="cz_ss" type="checkbox" id="jiaju93" value="水" <%if CheckPurview(idlist,"水")=True then response.write "checked"%>>