validação de checkbox
opa galera beleza?
estou com um pequeno problema, já pesquisa no forum no google...e não consigo achar...
quem conseguiu aqui no forum diz que foi por intermedio de um tal de adrianoalves
mas vamos ao meu caso
função JS
function seleciona_acao(){ document.f1.action = document.f1.seleciona.value; alert(document.f1.action); for (i=0; i < document.f1.elements.length; i++){ if(document.f1.elements[i].checked < 1){ alert("errooooorrrrrrrrrrr"); return false; } if(document.f1.elements[i].checked == 1){ alert("correto"); return false; } }}
form
<form name="f1" method="POST"> <table border=0> <tr> <th> </th> <th>Nome</th> <th> </th> <th>Seção</th> </tr> <?php do{ $id_func = $linha["id_func"]; $id_secao = $linha["id_secao"]; $nome = $linha["nome"]; $secao = $linha["secao"]; ?> <tr> <td><input type="checkbox" name="idss[]" value=<?php echo $id_func ?>></td> <td><?php echo $nome ?></td> <td> </td> <td><?php echo $secao ?></td> </tr> <?php }while ($linha = mysql_fetch_assoc($resultado)); } ?></table><a href="javascript:marcar_todos()">Marcar Todos</a> <a href="javascript:desmarcar_todos()">Desmarcar Todos</a><select name="seleciona"> <option value="sist_tel_atualiza.php">atualizar</option> <option value="sist_tel_deleta.php">deletar</option> </select><input type="Button" value="Confirmar" onclick="seleciona_acao();"></form>
bom galera se alguem puder me ajudar!!!
valeu
Discussão (1)
Carregando comentários...