Ir para conteúdo
Fórum Script Brasil
  • 0

Dúvida Sobre Trabalho Com Checkbox


hellxande

Pergunta

Bom dia a todos

Depois de procurar em vários Posts relacionados a CkeckBox, infelizmente não consegui encontrar ou entender algo que me auxilia-se, sendo assim resolvi postar a minha situação:

Tenho em meu código 1 CkeckBox carregado com os dados de uma Tabela, no caso acabam aparecendo 3 CheckBox com os registros da tabela em modo de execução.

Minha dúvida é: Na hora da gravação como saber qual dos Registros do CheckBox's foi selecionado ?

Segue o Código para avaliação:

<!--#include file="Conexao.asp" -->
<%
tabCod = Server.CreateObject("adodb.recordset")
sql = "SELECT * FROM Destino where DestinoID = "&request.querystring("cod")&""
set tabCod = db.execute(sql)
%>
<html>
<head>
<title>Documento sem título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="Def_Cota.asp">
  <table width="80%" cellpadding="0">
    <tr> 
      <td width="53%" rowspan="2" valign="top"> 
        <%
        tab2 = Server.CreateObject("adodb.recordset")
        sql = "select * from Modalidade"
        set tab2 = db.execute(sql)
        %>
        <table width="100%" cellpadding="0">
          <tr> 
            <td><strong>Escolha a Modalidade :</strong></td>
          </tr>
        </table>
        <% while not tab2.eof %>
        <table width="100%" cellpadding="0">
          <tr> 
            <td><input type="checkbox" name="checkbox" value="checkbox"> <%=tab2("ModalidadeNome")%></td>
          </tr>
          <%
          tab2.movenext
          wend
          %>
        </table>
        <br> <br> 
        <%
        tab3 = Server.CreateObject("adodb.recordset")
        sql = "select * from Origem"
        set tab3 = db.execute(sql)
        %>
        <table width="100%" border="0" align="center">
          <tr> 
            <td><strong>Selecione a Cidade de Origem :</strong></td>
          </tr>
          <tr> 
            <td>
            <select name="select" id="select2">
            <% while not tab3.eof %>
            <option value="<%=tab3("OrigemNome")%>"><%=tab3("OrigemNome")%></option>
            <%
            tab3.movenext
            wend
            %>
            </select>
            </td>
          </tr>
        </table>
        <br> <br> 
        <%
        tab4 = Server.CreateObject("adodb.recordset")
        sql = "select * from Pessoa"
        set tab4 = db.execute(sql)
        %>
        <table width="100%" border="0" align="center">
          <tr> 
            <td><strong>Quantidade de Pessoas : </strong></td>
          </tr>
        </table>
        <% while not tab4.eof %>
        <table width="100%" border="0" align="center">
          <tr> 
            <td>
            <label> 
              <input name="QtdPessoas" type="text" id="QtdPessoas" size="1" maxlength="3" /><%=tab4("PessoaNome")%>
            </label>
            </td>
          </tr>
          <%
          tab4.movenext
          wend
          %>
        </table>
        <br> <br> 
        <%
        tab5 = Server.CreateObject("adodb.recordset")
        sql = "select * from AptoTipo"
        set tab5 = db.execute(sql)
        %>
        <table width="100%" border="0" align="center">
          <tr> 
            <td><strong>Tipo de Acomodações : </strong></td>
          </tr>
        </table>
        <% while not tab5.eof %>
        <table width="100%" border="0" align="center">
          <tr> 
            <td>
            <label> 
              <input name="CheckApto" type="checkbox" id="CheckApto" value="<%=tab5("AptoTipoNome")%>" /><%=tab5("AptoTipoNome")%>
            </label>
            </td>
          </tr>
          <%
          tab5.movenext
          wend
          %>
        </table></td>
      <td width="47%" height="410" valign="top"> 
        <%
        tab6 = Server.CreateObject("adodb.recordset")
        sql = "select * from Hotel"
        set tab6 = db.execute(sql)
        %>
        <table width="100%" border="0" align="center">
          <tr> 
            <td width="195"><strong>Hoteis </strong></td>
            <td width="89"><strong>Valor</strong></td>
          </tr>
        </table>
        <% while not tab6.eof %>
        <table width="100%" border="0" align="center" id="Hotel">
          <tr> 
            <td width="195"><%=tab6("HotelNome")%></td>
            <td width="89"> </td>
          </tr>
          <%
          tab6.movenext
          wend
          %>
        </table>
        <br> <table width="100%" cellpadding="0">
          <tr> 
            <td><input name="hiddenField" type="hidden" value="<%=(tabCod.Fields.Item("DestinoNome").Value)%>"></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td valign="middle">
      <div align="right"><input type="submit" name="Submit" value="Prosseguir"></div>
      </td>
    </tr>
  </table>
</form>
</body>
</html>

Desde já agradeço a ajuda de todos.

Atenciosamente

Hellxande

Editado por hellxande
Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...