HTML code<form id="form1" name="form1" method="post" action="">
<%for i=1 to 10%>
<input name="checkbox" type="checkbox" id="checkbox" value="1" <%if instr(","&a&",",","&i&",")>0 then response.Write "checked"%> />
<%next%>
</form>
[/Quote]
我试了一下,放到动态生成复选框的那里好像不行。我的动态生成复选框的代码是这样写的。
<%
Set rsmod=Server.CreateObject("ADODB.RecordSet")
sql1="select * from project_info where project='"&rs1("Project")&"';"
rsmod.Open sql1,conn,3,3
htm=""
modtext=rs1("Model")
if not(rsmod.bof and rsmod.eof) then
html = "<span id=checkboxs>"
do while not rsmod.eof
html = html&"<input name=checkbox type=checkbox value='"&rsmod("model")&"'>"&rsmod("model")&" "
rsmod.movenext
loop
html = html&"</span>"
end if
rsmod.close
set rsmod=nothing
response.write html
%>