Hi, I have a checkbox in each row of the table, but it send its value only in first page. In all other pagesthe checkbox is visibile but can't send its value.
Could you help me?
The issue here is that DataTables will remove elements that it does not require to display the current page from the document (i.e. all rows other than the displayed page). It does this both for performance and compatibility reasons, but it means that when you submit a form, the browser only sees the form elements on the current page.
There are a number of ways to address this:
1. If using Ajax - you can obtain all of the form information from the DataTable using its API like this: http://datatables.net/release-datatables/examples/api/form.html .
2. If not using Ajax - one submit move all of the form elements into the form - you could do that like this:
Replies
The issue here is that DataTables will remove elements that it does not require to display the current page from the document (i.e. all rows other than the displayed page). It does this both for performance and compatibility reasons, but it means that when you submit a form, the browser only sees the form elements on the current page.
There are a number of ways to address this:
1. If using Ajax - you can obtain all of the form information from the DataTable using its API like this: http://datatables.net/release-datatables/examples/api/form.html .
2. If not using Ajax - one submit move all of the form elements into the form - you could do that like this:
[code]
$('#myForm').on( 'submit', function () {
table.$('input').appendTo( '#myForm' );
} );
[/code]
In that case, the fact that the DOM elements for the form are no longer in the table doesn't matter since the page will refresh anyway.
Do you have an example page that you could link to so I can take a look?
Thanks,
Allan