whenever i click add record record has to display in table format and store the values in corresponding arrays !!,values are storing in arrays ,records are diplaying in table format in same jsp

whenever i click add record record has to display in table format and store the values in corresponding arrays !!,values are storing in arrays ,records are diplaying in table format in same jsp

var empidlist =[];
var empnamelist =[];
var dutieslist =[];
function doAjaxPost() { 
   
    alert("we are in ajax do post method");
      
    var empid = $('#emp_id').val(); 
     empidlist.push(empid);
       var ename = $('#txtHint1').html();
     empnamelist.push(ename);
     var noofduties = $('#noofduties').val(); 
     dutieslist.push(noofduties);
       $(document).ready(function(){
      $("#form1").submit(function(event) {
            alert("Thank you for your comment!");
           
           
            //event.preventDefault();
                         
            $.ajax({ 
               type : "GET",
              traditional: true,
              url : "/security/twelvehrspattern.html",
                data : "empidlist="+empidlist+"&empnamelist="+empnamelist+"&noofduties="+noofduties,
                contentType: "application/json; charset=utf-8",
                success : function(response) { 
                 alert(response);  
                 
                }, 
                error : function(e) { 
                 alert('Error: ' + e);  
                } 
               }); 
      });