Q:

How can I pass the input box value on clicking anchor tag to php?

I want to pass the value for each rows to php page to update in database I am able to pass only id not the input box value 
This is the table body
  <?php
  $cards = mysqli_query($con,"SELECT Username, Card_No, Card_Status FROM 
  smartcard WHERE Card_Status NOT IN (SELECT Card_Status FROM smartcard where Card_Status = 'Issued')");
  ?>
 <tbody>
        <?php
        while ($row = mysqli_fetch_assoc($cards))
        {
            echo '<tr>';
            foreach ($row as $key => $value) {
                echo '<td style="word-wrap: break-word;min-width: 10px;max-width: 300px;">',$value,'</td>';
            }            
            echo '<td><form action="php/issue_card.php" method="POST"><input id="textbox" name="new_status" type="text" class="form-control" required="required"/></form></td>';
            echo "<td><a href='php/issue_card.php?id=".$row['Card_No']."'><button type=\"button\" class=\"btn btn-link\">Status Update</button></a></td>";
            echo '</tr>';
        }
        ?>
 </tbody>

This is the php page issue_card.php
 <?php
  include("connect.php");
  $con = OpenCon();
  $smartcard_no = $_GET['id'];
  $admin_id = $_SESSION['Admin_Id'];
  $new_status = $_POST['new_status'];
  $sql = "UPDATE smartcard SET Card_Status = '$new_status', Admin_Id ='$admin_id' WHERE smartcard.smartcard_no = $smartcard_no";
   mysqli_query($con, $sql);
  CloseCon($con);
  ?>

For each row there will be different smartcard_no so I am using anchor tag to pass that directly using GET but not able to pass input box value.

A:

The following is a quickly written ( and not tested ) example of the 2nd idea - where there is just one form that encompasses the entire table and has two hidden fields for the important pieces of data that you wish to POST to the PHP script.
Each button within the table is assigned an event handler - the event handler in this case will query the DOM to find the text field within the same row and then assign that value and the value found in the buttons own data-id attribute o the hidden input fields before submitting the form.
<script>
    document.addEventListener('DOMContentLoaded',function(e){

        /* Obtain a reference to the FORM element */
        var form=document.forms['status-updates'];      

        /* Hidden fields which will be POSTed to php/issue_card.php */
        var id=form.querySelector('input[type="hidden"][name="id"]');
        var status=form.querySelector('input[type="hidden"][name="new_status"]');

        /* Create a nodelist collection of ALL buttons within table of class "bttn" */
        var col=Array.prototype.slice.call( form.querySelectorAll('input[type="button"].bttn') );

        /* Assign event handler to each button */
        col.forEach( function( bttn ){
            bttn.onclick=function(e){/* - event handler - */

                /* Assign values to hidden fields */
                id.value=this.dataset.id;
                status.value=this.parentNode.querySelector('input[type="text"]').value;

                /* submit the form with values for this row */
                form.submit();
            }.bind( bttn );
        });
    },false );
</script>

<form name='status-updates' method='post' action='php/issue_card.php'>
    <!-- two hidden fields -->
    <input type='hidden' name='id' />
    <input type='hidden' name='new_status' />

    <table>
        <?php
            while( $row = mysqli_fetch_assoc( $cards ) ) {
                echo "
                <tr>";

                foreach( $row as $key => $value ) echo "
                    <td class='wrap'>{$value}</td>";

                echo "
                    <td>
                        <input type='text' class='form-control' required='required' />
                        <input type='button' value='Status Update' class='bttn' data-id='{$row['Card_No']}' />
                    </td>
                </tr>";
            }
        ?>
    </table>
</form>

