Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get table row data onclick

 $(document).ready(function(){
  
  $(".re-ass-taskbt_table").on('click','.re-ass-taskreasonbtn',function(){
       var currentRow=$(this).closest("tr"); 
       //var hr_id = currentRow.find("td:eq(0) input[type='hidden']"). val();
      var col1=currentRow.find("td:eq(0)").text(); // get current row 1st TD value
       var data=col1;
  $('#re-ass-task_modal').modal('show');
  $('#re-assignid_task').val(col1);
  $.ajax({
  url:'/hr_modal_show',
  type:'get',
  dataType:'json',
  data:
  {
      hr_id:hr_id
  },
  success:function(data)
  {
    $('#hr_father').val(data[0][0]['father_name']);
  }
  });
  });

  });
  
 
PREVIOUS NEXT
Tagged: #table #row #data #onclick
ADD COMMENT
Topic
Name
1+6 =