Q:

DataTable records are not submitting which are not visible on search

I am using DataTable in one of my form which is working fine.
$('#example_filter').dataTable
  pageLength: 25

Rows in DataTables are submitting with form.
Problem
If I have 4 records in DataTable and I write something in DataTable search field which results in 2 records and make the remaining 2 (unmatched) records hidden. The hidden records are not submitting with my form.
What I am trying is:
Clear DataTable search field before submitting the table and make all rows visible.
$('#example_filter :input').val("")

This line is clearing the DataTable search field but not making all rows visible.

A:

Place this script before submitting your form. i.e. On Click event for submit button.
JavaScript
$(document).on('click', '#submit-button-id', function(e) {
  var table;
  table = $('#example_filter').DataTable();
  return table.search('').columns().search('').draw();
});

CoffeeScript
$(document).on 'click', '#submit-button-id', (e) ->
  table = $('#example_filter').DataTable()
  table.search('').columns().search('').draw()

