M. Fahmi Ulul Azmi M. Fahmi Ulul Azmi - 11 months ago 43
Ajax Question

How to input menu and show the data without save on the database?

form image

I have a form input menu and quantity here (yellow line on pic). When I submit that the data is shown on the table (red line on pic) but is not saved on database (show only). Then I have a save button in the bottom (not yet on the picture because it is cropped) that will store the data that we have input earlier (which appear in the table).

How do I get the input from the menu to only appear in the table but later (after press the save data) is fed into the database?

I'm using CodeIgniter, AJAX and jQuery.

Answer Source

You can use jquery to show input field content in table, here is an example https://jsfiddle.net/y2vmqL06/.

$("input").on('keyup change', function(){
  if($(this).val() != ""){

On submit you can use php to do normal database operations