table data and getting input data marge store two tables , 1) purchase_invoice 2)purchase_invoice_details and also update product table quantity view <button class = "btn btn-success pull-right" onclick= "savePurchaseOrder();" > <span class = "glyphicon glyphicon-saved" aria-hidden= "true" ></span> Create Order</button> JavaScript < script > // ******************************************************** // * save purchase order * // ******************************************************** function savePurchaseOrder () { var e = document . getElementById ( "supplier_id" ); var supplier_id = e . options [ e . selectedIndex ]. value ; var dataString = '&supplier_id=' + supplier_id ; var TableData ; // TableData = $.toJSON(st