title: Get user input in table to send to database
body: <p>I apologize if this is confusing, I am very new to coding.</p>
  <p>I have an HTML web page with a table in javascript that pulls from a database in postgre. Right now, you can view the table and click on individual cells, but I want users to be able to overwrite any cell in the last column and for their input to be added to the database that the original table was pulled from.</p>
  <p>Does anybody know how to do this?</p>
  <p>Thank you! :)</p>
  <pre><code>var endpoint = '/reports/lead_time/endpoint' $(document).ready(function() {
  
  $('#lead_time thead tr').clone(true).appendTo( '#lead_time thead' );
  $('#lead_time thead tr:eq(1) th').each( function (i) {
      var title = $(this).text();
      $(this).html( '&lt;input type=&quot;text&quot; placeholder=&quot;'+title+'&quot; /&gt;' );
  
      $( 'input', this ).on( 'keyup change', function () {
          if ( table.column(i).search() !== this.value ) {
              table.column(i).search( this.value ).draw();
          }
      } );
  } );
  
  var table = $('#lead_time').DataTable( {
      orderCellsTop: true,
      scrollY: &quot;700px&quot;,
      scrollX: true,
      pageLength: 50,
      order: [[ 1, &quot;asc&quot; ]],
      processing: true,
      serverSide: true,
      search: &quot;Quick Search...&quot;,
      dom: 'Blfrtip',
      keys: true,
      deferRender: true,
      scroller: true,
      infoFiltered: &quot;(Filtered from _MAX_ total entries)&quot;,
      searching: true,
      language: {
          processing: &quot;Processing...&quot;,
          search:&quot;Quick Search:&quot;,
      },
      ajax: {
          &quot;method&quot;:&quot;GET&quot;,
          &quot;url&quot;: endpoint,
          &quot;serverSide&quot;: true,
      },
      buttons: [
          'columnsToggle'
      ],
      columns: [
          { data: 'part_no'},
          { data: &quot;supplierid&quot; },
          { data: &quot;item_minimum&quot; },
          { data: &quot;item_q1&quot; },
          { data: &quot;item_median&quot; },
          { data: &quot;item_q3&quot; },
          { data: &quot;vendor_minimum&quot; },
          { data: &quot;vendor_q1&quot; },
          { data: &quot;vendor_median&quot; },
          { data: &quot;vendor_q3&quot; },
          { data: &quot;lead_time&quot; },
          { data: &quot;lt_type&quot; },
          { data: &quot;lt_override&quot; },
      ],
  } );
  
  $('a.toggle-vis').on( 'click', function (e) {
      e.preventDefault();
  
      // Get the column API object
      var column = table.column( $(this).attr('data-column') );
  
      // Toggle the visibility
      column.visible( ! column.visible());
  } );
  
  
  $('#lead_time tbody').on( 'click', 'td', function () {
      console.log( table.cell( this ).data() );
  } );
  </code></pre>
  <p>} );</p>