checkbox not work or no datatable
checkbox not work or no datatable
chiaraeblue
Posts: 1Questions: 1Answers: 0
**Debugger code **:
<script src="../js/jquery-3.2.1.js" type="text/javascript"></script>
<script src="../js/bootstrap.bundle.min.js"></script>
<script src="../js/jquery.dataTables.js"></script>
<script src="../js/dataTables.bootstrap4.js"></script>
<script type="text/javascript">
function submitAdd(){
document.forms[0].submit();
}
$(document).ready(function() {
$('#tab').DataTable( {
paging: false,
language: {
url: '../js/dataTables.Italian.json'
}
} );
});
</script>
[..]
<s:form action="Add" >
<table class="table table-bordered table-striped table-sm mb-0" id="tab">
...
<s:iterator value="elenco" var="elenco" status="stat">
<tr>
<td><input type="checkbox" name="idCheck" value="${ID}"></td>
...
</table> ..
<button onclick="javascript:submitAdd();" name="add"> ADD</button> ..
Description of problem: with this situation described it does not report anything in idCheck, while I noticed that by commenting /$('#tabella').DataTable( {.../ the checkbox works, but I lose the datatable with search..
Answers
Its hard to say what the problem is without seeing it. I copied your checkbox into this test case and it works:
https://live.datatables.net/mogiwoki/1/edit
Please update the test case or provide a link to a page that shows the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin