Click here to Skip to main content
16,022,069 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Failed to display/get the value of the table 1st column (userID) in 2nd page pagination in php bootstrap. But its working on the first page of the table


What I have tried:

<script type="text/javascript">
  $(document).ready(function(){
    $('.roleViewer').on('click', function(e){
      e.preventDefault();

      $('#roleViewer').modal('show');
      

        $tr = $(this).closest("tr");

        var data = $tr.children('td').map(function(){
          return $(this).text();
        }).get();

        console.log(data);

        $('#viewerID').val(data[0]);  //this value to be pass to pop up modal form to be used for updating record    
    });
  });
</script>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900