0
I would like to send the checkbox values, only those selected to a page using the window.open()
:
<div class='checkbox'>
<label><input type='checkbox' name='checkbox[]' value='Teste1'> Teste1</label>
<div>
<div class='checkbox'>
<label><input type='checkbox' name='checkbox[]' value='Teste2'> Teste2</label>
<div>
<div class='checkbox'>
<label><input type='checkbox' name='checkbox[]' value='Teste3'> Teste3</label>
<div>
<div class='checkbox'>
<label><input type='checkbox' name='checkbox[]' value='Teste4'> Teste4</label>
<div>
<div class='checkbox'>
<label><input type='checkbox' name='checkbox[]' value='Teste5'> Teste5</label>
<div>
<div class='btn-box'>
<button class='btn btn-info'>Enviar</button>
</div>
I tried that way but the values are sent like this:
<script>
$('.checkbox .btn').click(function(){
var inputValores = $('.checkbox input').serialize();
window.open('destino.php?' + inputValores);
});
</script>
The URL GETS:
destino.php?checkbox=Teste1&checkbox=Teste2&checkbox=Teste3....
CAN BE SENT LIKE THIS?
destino.php?checkbox[].....
Are you using jQuery?
– fernandosavio
Hi Fernandosavio solved the b.o., posted the solution below, thanks for the attention!
– ElvisP