$.ajax({ type: "POST", url: "ajaxRequests/createVrEntriesRows.php", data: "form_data=" + form_data +"&rows=" + rows, success: function(response){ $('#VR_Entries').append(response); } });
<?php require_once '../controllers/conn.php'; if(isset($_POST["form_data"])){ extract($_POST); $parts = explode('/', $domain_class); $class = isset($parts[0])?$parts[0]:''; $sub_class = isset($parts[1])?$parts[1]:''; $domain = isset($parts[2])?$parts[2]:''; $sr_no = $_POST['rows']+1; return '<tr> <td> <input type="hidden" name="sr_no[]" value="'.$sr_no.'">'.$sr_no.' </td> <td> <input type="hidden" name="job[]" value="'.$job.'">'.$job.' </td> <td> <input type="hidden" name="account[]" value="'.$account.'">'.$account.' </td> <td> <input type="hidden" name="class[]" value="'.$class.'">'.$class.' </td> <td> <input type="hidden" name="sub_class[]" value="'.$sub_class.'">'.$sub_class.' </td> <td> <input type="hidden" name="domain[]" value="'.$domain.'">'.$domain.' </td> <td> <input type="hidden" name="desc[]" value="'.$description.'">'.$description.' </td> <td class="debit"> <input type="hidden" name="debit[]" value="'.$debit.'">'.$debit.' </td> <td class="credit"> <input type="hidden" name="credit[]" value="'.$credit.'">'.$credit.' </td> <td> <button type="button" class="btn" onclick="DeleteRowFunction(this)">x</button> <button type="button" class="btn"> </button> </td> </tr>'; } ?>
json_encode
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)