How is the data in the second form sent to the table?

I want to send the data in more than one form to the table. I need help. My main goal is: I want to choose from the table containing SQL database data. Making a new table with row data ajax from the table on the screen

Sorry for the grammar.

$(document).ready(function() {
  var id = 1;
  $("#butsend,#butsend2").click(function() {
    var newid = id++;
    $("#table1").append('<tr valign="top" id="' + newid + '">\n\
<td width="100px" >' + newid + '</td>\n\
<td width="100px" class="name' + newid + '">' + $("#name").val() + '</td>\n\
<td width="100px" class="sname' + newid + '">' + $("#sname").val() + '</td>\n\ </tr>');
<link rel="stylesheet" href="">
<script src=""></script>

<div style="margin: auto;width: 60%;">
  <form id="form1" name="form1" method="post">
    <div class="form-group">
      <input type="text" name="name" class="form-control" id="name">
    <div class="form-group">
      <input type="text" name="sname" class="form-control" id="sname">
    <input type="button" name="send" class="btn btn-primary" value="add data" id="butsend">

  <form id="form2" name="form2" method="post">
    <div class="form-group">
      <input type="text" name="name2" class="form-control" id="name2">
    <div class="form-group">
      <input type="text" name="sname2" class="form-control" id="sname2">
    <input type="button" name="send2" class="btn btn-primary" value="add data2" id="butsend2">

  <table id="table1" name="table1" class="table table-bordered">

Read more here:

Content Attribution

This content was originally published by Mbbbe at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: