Recuperar dados checkbox
Pessoal. Boa noite, sou novo no forum e estou batendo cabeça com um código relativamente simples. Tenho uma pagina que me traz os registros normalmente. Ai inclui um checkbox para que o usuario selecione quais os registros "checkados" quer para imprimir. Já tentei de varias maneiras mas sem sucesso. Até consegui fazer mas ele traz somete um registro e preciso trazer somente os selecionados para impressão (data, nomepaciente, medico, tbl_protocolo_convenio). Não precisa gravar no banco. Segue o código para analise. Se alguém puder ajudar agradeço.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001" LCID="1046"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%
Dim oConn
set oConn = createobject("adodb.connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("consultas.mdb")
set rs3 = createobject("adodb.recordset")
rs3.open "select data, nomepaciente, medico, tbl_protocolo_convenio from prot ORDER BY data ASC" ,oConn,3,3
%>
<title>Oncoclinica :: Protocolo</title>
<style type="text/css">@import "css/estilo.css";</style>
</head>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="imgs/barra_menu.gif" width="800" height="100" /></td>
</tr>
<tr>
<td colspan="3"><img src="imgs/barra_linha.gif" width="800" height="10" /></td>
</tr>
<tr>
<td><table width="800" border="0" align="center" cellpadding="0">
<tr>
<td><div class="txtprincipal">
<div align="left">PROTOCOLO DE ENTREGA</div>
</div></td>
<td><div class="txtprincipal"><div align="right"><%response.write(Date)%></div></td>
</tr>
</table></td>
</tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="imgs/barra_linha.gif" width="800" height="10" /></td>
</tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="91"><div align="left" class="menu_lista">Data</div></td>
<td width="333"><div align="left" class="menu_lista">Nome</div></td>
<td width="130"><div align="left" class="menu_lista">Convênio</div></td>
<td width="246"><div align="left" class="menu_lista">Medico</div></td>
</tr>
<tr>
<td colspan="4"><img src="imgs/barra_linha.gif" width="800" height="3" /></td>
</tr>
<%If rs3.EOF and rs3.BOF then
'ou seja, se o resultado vier vazio
'response.write "Venda inexistente!"
'response.redirect("cadastro_off.asp")
response.end
else
rs3.MoveFirst
While not rs3.Eof%>
<form action="print.asp" method="post" name="checado">
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="90"><div align="left" class="lista"><%=rs3("data")%></div></td>
<td width="337"><div align="left" class="lista"><%=rs3("nomepaciente")%></div></td>
<td width="130"><div align="left" class="lista"><%=rs3("tbl_protocolo_convenio")%></div></td>
<td width="150"><div align="left" class="lista"><%=left(rs3("medico"),16)%></div></td>
<td width="93"><div align="center" class="lista"><input type="checkbox" name="seleciona" value="<%=rs3("nomepaciente")%>" /></div></td>
</tr>
<%
rs3.MoveNext
wend
%>
</table>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><img src="imgs/barra_linha.gif" width="800" height="10" /></td>
</tr>
<tr>
<td>
<div align="left" class="lista">
<%
if rs3.Supports(adApproxPosition)=true then
i=rs3.RecordCount
response.write("Quantidade de guias: " & i)
end if%>
</div>
</td>
<td align="right"><label>
<input type="submit" name="button" id="button" value="Enviar" />
</label>
</form>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><div align="left" class="menu_lista">Recebido por:______________________________________________ Data:___/___/_______</div></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><img src="imgs/barra_linha.gif" width="800" height="10" /></td>
</tr>
</table>
<%
rs3.Close
oConn.Close
Set rs3 = Nothing
Set oConn = Nothing
end if
%>Discussão (0)
Carregando comentários...