GOOD I am trying to send an ajax array to java but it only sends me a data and I want it to send the ones I choose in the checkbox
function checkBoxElm_fav() {
var Selec = document.getElementById("Selec").value;
alert("cheked" + Selec);
$.ajax({
type: "POST",
dataType: 'text',
url: "bandeja_entrada.htm",
data: {
'Selec': Selec
},
success: function(response) {
window.location.replace("bandeja_entrada.htm");
},
});
}
function elim_fav() {
alert("entre");
checkBoxElm_fav();
var d = document.getElementById("Selec").value;
}
<a onclick="elim_fav()" name="prueba" id="prueba" title="Borrar Usuarios" class="text-left"><span class="icon"><i class="icon-trash"></i></span></a>
<table id="tb_com" class="table table-bordered ">
<thead>
<tr>
<th></th>
<th>favorito</th>
</tr>
</thead>
<tbody>
<c:forEach items="${favorito_foreach}" var="dato">
<td><input type="checkbox" name="Selec[]" id="Selec" value="${dato.idFavorito}" /></td>
<td>
<c:out value="${dato.favorito}" />
</td>
</c:forEach>
</tbody>
</table>
checkbox