2
As I can pass to a php page a checkbox list selected, I have this that shows me the checkbox, but I’m having trouble sending them to php.
function SelecionaChecks() {
var Check = document.getElementsByName("check");
for (var i=0;i<Check.length;i++){
if (Check[i].checked == true){
// CheckBox Marcado
alert(Check[i].value + " selecionado.");
} else {
// Nenhum checkbox marcado
}
}
}
My checks are coming from that appointment:
<div class='row'>
<div class='span12'>
<div class='barra-btn table-bordered'>
<div class='btn-group'>
<button class='btn btn-large' type='button' title='Marcar/Desmarcar todos' id='todos' onclick='marcardesmarcar();'><i class='icon-large icon-ok'></i></button>
<button class='btn btn-large' type='button' title='Imprimir'><i class='icon-large icon-print'></i></button>
<button class='btn btn-large' type='button' title='Enviar mensagem' onclick="SelecionaChecks()" ><i class='icon-large icon-message-plus'></i></button>
<button class='btn btn-large' type='button' title='Adicionar comentário'><i class='icon-large icon-notes'></i></button>
<button class='btn btn-large' type='button' title='Relacionar com uma vaga'><i class='icon-large icon-inbox-plus'></i></button>
</div>
</div>
</div>
</div>
From that loop on that form:
<div class='row'>
<div class='span12'>
<form id="selecao">
<table class='table table-bordered'>
<tbody>
<?php
do {
if ($totalRows_rsRegistro > 0) {
// Resgatando ID´s para gerar pdf e envio de e-mails
$IdCandidato = $row_rsRegistro['id_candidato'];
?>
<tr>
<td width='2%'><input type='checkbox' class='marcar' name='check' id='check' value="<?php echo $IdCandidato; ?>"/></td>
<td width='5%' align='center'>
<div class='btn-group btn-group-vertical'>
<button class='btn btn-small' type='button' title='Imprimir'><i class='icon-large icon-print'></i></button>
<button class='btn btn-small' type='button' title='Enviar mensagem'><i class='icon-large icon-message-plus'></i></button>
<button class='btn btn-small' type='button' title='Adicionar comentário'><i class='icon-large icon-notes'></i></button>
<button class='btn btn-small' type='button' title='Relacionar com uma vaga'><i class='icon-large icon-inbox-plus'></i></button>
</div>
</td>
<td width='70%'><span class='titulo_18 bold'><a href="admin/vercurriculo.php?id=<?php echo $IdCandidato; ?>" class="a-titulo"><?php echo $row_rsRegistro['nome']; ?></a></span></br>
<?php echo $row_rsRegistro['email']; ?></br>
<?php echo $row_rsRegistro['celular']; ?></br>
<?php echo $row_rsRegistro['id_municipio']; ?> | <?php echo $row_rsRegistro['id_uf']; ?></td>
<td width='23%'><span class='titulo_14'>Dados gerais</span>
</td>
</tr>
</tbody>
<?php
} else {
echo "<div align='center'>Não existe(m) curriculo(s) para ser(em) exibido(s)</div></br>";
}
} while ($row_rsRegistro = mysql_fetch_assoc($rsRegistro));
?>
</table>
</form>
</div>
</div>
</div>
Can’t use
<form>
?– Sergio
I don’t understand your question Sergio.
– adventistapr
Good you have edited the question and added code! Now I see you already have one
<form>
but without "action". You want to send and change/reload the page or send keeping the page?– Sergio
Keeping the Sergio page, later I understood your question and so I decided to edit the post.
– adventistapr