Jump to content
Fórum Script Brasil
  • 0

Validação Javascript


Guest Daniel Jordan
 Share

Question

Guest Daniel Jordan

Fala galera, é o seguinte preciso de validação para um checkbox , o usuario so vai poder dar um sbmit se pelomenos 1 dos checkbox estiver selecionado. So q tem um porem a quantidade de checkbox vem do banco de dados, então eu posso ter de 1 à 9 checkbox. Aguem pode me ajudar por favor?Obrigado.

<logic:iterate id="beneficiarios" name="beneficiariosCD">
    <%
     int cont = 0;
     for (int i  = 0; i <  Integer.parseInt(quantidadeBeneficiarios);  i++){ 
     %>
        <tr class="linha">
            <td width="2%" class="conteudo"> <input type="checkbox" name="checkboxDesativar0<%=cont%>" value="<jsp:getProperty name="beneficiarios" property ="numeroSequencialDependente"/>"></td>
            <td width="27%" class="conteudo"><jsp:getProperty name="beneficiarios" property ="nome"/></td>
            <td width="16%" class="conteudo" style="text-align: center"><jsp:getProperty name="beneficiarios" property ="dataDeNascimento"/></td>
            <td width="14%" class="conteudo" style="text-align: center"><jsp:getProperty name="beneficiarios" property ="sexo"/></td>
            <td width="15%" class="conteudo" style="text-align: center"><jsp:getProperty name="beneficiarios" property ="grauDeParentesco"/></td>
            <td width="29%" class="conteudo" style="text-align: center">
            <jsp:getProperty name="beneficiarios" property ="numeroIdentidade"/>/
            <jsp:getProperty name="beneficiarios" property ="orgaoEmissorIdentidade"/>
                        
            <input type="hidden"  name="nomeBeneficiario0<%=cont%>"                value="<jsp:getProperty name="beneficiarios" property ="nome"/>">
            <input type="hidden"  name="dataNascimentoBeneficiario0<%=cont%>"   value="<jsp:getProperty name="beneficiarios" property ="dataDeNascimento"/>">
            <input type="hidden"  name="sexoBeneficiario0<%=cont%>"                value="<jsp:getProperty name="beneficiarios" property ="sexo"/>">
            <input type="hidden"  name="grauParentescoBeneficiario0<%=cont%>"   value="<jsp:getProperty name="beneficiarios" property ="codigoDoGrauDeParentesco"/>">
            <input type="hidden"  name="identidadeBeneficiario0<%=cont%>"       value="<jsp:getProperty name="beneficiarios" property ="numeroIdentidade"/>/<jsp:getProperty name="beneficiarios" property ="orgaoEmissorIdentidade"/>">
        
            </td>
        </tr>
    <%cont++; } %>
</logic:iterate>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.7k
×
×
  • Create New...