I'd like to preface this that I have searched EVERYWHERE for a potential solution, with no avail. I am a very loong time lurker of this community.

I have a really weird problem with my Jquery code. I have a form that posts the value of a checkbox, and points associated with it if its checked. This works if there is only one table. However,my requirement is to move that row into a new table when it is checked. My dilemma here is making the 2nd table post points after moving the row from the first table to the second table.

Here is how that looks like:

My two tables, Mytable and my Table1, Mytable1 will have the form:

<div class="flex"> <table id="myTable"> <tr class="header"> <th style="width:20%;">Topic</th> <th style="width:20%;">Points</th> </tr> <?php $x=0; $y=0; while($y<sizeof($test['id'])){ echo "<tr>"; echo "<td><input type='textarea' class='points' name='points[]' id='points$x'></textarea>"; echo "<input type='checkbox' name='check[]' class='checkbox' id='Checkbox$x' value='".$test['id'][$x]."'></td>"; $x++; echo "</tr>"; } ?> </table> </div> <div class="fixed"> <form id=myform> <table id="myTable1"> <h6>Exam Table</h6> <tr class="header"> <th style="width:20%;">Topic</th> <th style="width:20%;">Points</th> </tr> </table> <button type="submit">Submit</button>

My Ajax Script:

<script> //ajax to submit $(function(){ $("#myform").submit(function(event){ event.preventDefault(); $.ajax({ url:'maketest.php', type:'POST', data:$(this).serialize(), success:function(result){ $("#response").text(result); } }); }); }); </script>

Script To move the row from mytable to mytable1:

<script> //jquery to move row into another table $('body').on('click','#myTable tbody tr td input.checkbox', function(){ if( $(this).attr('checked')){ var row = $(this).closest('tr').clone(); $('#myTable1 tbody').append(row); $(this).closest('tr').remove(); } }); $('body').on('click','#myTable1 tbody tr td input.checkbox', function(){ var row = $(this).closest('tr').clone(); $('#myTable tbody').append(row); $(this).closest('tr').remove(); }); </script>

Its two simple tables, mytable1 is empty, but with the jquery script it will be populated with the transfered row. the code for the moving table was used from this beautiful jsfiddle and decided to adopt it. The row moves and everything, but when I submit the form, the points randomly work for some certain checkboxes, but not all of them.

Most of the time , only the checkbox values get posted. I have no idea how to even approach this issue, and any idea on why the jquery omitting the points in my ajax will be sooo helpful!!