Hola, podría ayudarme alguién con este código:
<br>
<form name="checkagencias" method="GET" target="_blank">
<%
Response.write "<br>; <br>"
Set RS = Server.CreateObject("ADODB.Recordset")
SQL="SELECT NOMBRE, ID FROM AGENCIAS WHERE ID <> " & id_cambiar & " AND ID <> 13 Order by NOMBRE ASC"
RS.open SQL, Conn
Response.write "<table width='75%' border='0' cellspacing = '0' cellpadding = '0' ><tr class = 'topAdminRow'>"
Response.write "<td width = '10%' align='center' class='TBorderLeftTop' rowspan = '2'></td>"
Response.write "<td width = '90%' class='TBorderTopRight' colspan = '3'>"
Response.write "<font face='arial' size='2'>"
Response.write " <br></font></td></tr>"
%>
<tr>
<td width="100%" align = "center" class='TBorderTopRight'>
<b>Nombre Agencia</b>
</td>
</tr>
<%
Set Consulta = Server.CreateObject("ADODB.Recordset")
SQL="SELECT ID_2 FROM COLABORACIONES WHERE ID_1 = " & Session("id_agencia") & " AND ID_2 <> 13" & " AND ID_2 <>" & id_cambiar
Consulta.open SQL, Conn
Do while not RS.eof
userName = RS("nombre")
%>
<tr>
<td width="10%" align = "center" class='TBorderLeftTop'>
<%
encontrado = false
idag = RS("ID")
Do while not Consulta.eof and encontrado = false
id2 = Consulta("id_2")
if (idag = id2) then
encontrado = true
end if
Consulta.movenext
loop
if encontrado then
%>
<!--<input type="checkbox" name="ID" value="Checked" onClick="Checked()">-->
<input type="checkbox" name="alta" value="ON">
<%else%>
<input type="checkbox" name="alta" value="ON">
<%end if%>
</td>
<td width="75%" class='TBorderTopRight'>
<font face="Arial, Helvetica, sans-serif" size = "2"> <%=userName%> </font>
</td>
</tr>
<%
RS.MoveNext
loop
%>
<tr height = "1">
<td width="10%" class='TBorderTop' height = "1"> </td>
<td width="90%" class='TBorderTop' height = "1" colspan = "3"> </td>
</tr>
</table>
<%
rs.close
end if
%>
</form>
Notas:
Consigo ver una tabla con dos columnas, la primera columna tiene checkbox y la segunda nombres:
[] Nombre_1 ... [] Nombre_N
Necesito obtener en las checkbox el valor activado o no según la base de datos que tengo.
Necesito poder modificar la base de datos según si activo o no la checkbox dependiendo del nombre que tenga al lado de la misma.
Muchas gracias.