JavaScript Datatables submit form with hidden input fields

Submit all selected input fields using Datatables even if they are hidden because of the paging.

<form action="?" method="post" id="update">
  <div id="hidden_submit"></div>
  <table id="content">
  <!-- Datatables hidden inputs -->
  </table>
</form>

<script type="text/javascript">
$(document).ready(function(){

  var oTable = $('#content').dataTable();

  $('#update').submit(function(e){

    $('#hidden_submit').html('');

    $('input', oTable.fnGetNodes()).each(function(){
      if ($(this).attr('checked') && $(this).is(':hidden'))
      {
        var clone = $(this).clone(true);
        $('#hidden_submit').append(clone);
      }
    });

  });
});
</script>