Jquery submit does not work after ajax pagination

I am using an ajax pagination script which works fine – https://github.com/gbirke/jquery_pagination

On the first page everything works great, there are submit buttons (multiple forms) on each page, which send data to the database via a jquery POST.

However, the jquery post only works for forms/buttons on the first page that is loaded. If you switch to another page on the pagination the jquery post / submit button does not work.

Any suggestions would be much appreciated, can’t seem to figure it out.


Main code snippets:

Pagination Scripts

$(document).ready(function() {
$("#Pagination").trigger('setPage', [<?php echo $member_Program_Week_calc; ?>]);

<script type="text/javascript">
function pageselectCallback(page_index, jq){
var new_content = jQuery('#hiddenresult div.result:eq('+page_index+')').clone();
return false;

function initPagination() {
// count entries inside the hidden content
var num_entries = jQuery('#hiddenresult div.result').length;
// Create content inside pagination element
$("#Pagination").pagination(num_entries, {
callback: pageselectCallback,
items_per_page:1 // Show only one item per page

// When document is ready, initialize pagination

ajaxSubmit function

<script type="text/javascript">
$(document).ready(function() {

$('#completetask_<?php the_sub_field('tasks_id'); ?>').submit(ajaxSubmit); // example

function ajaxSubmit(){


var completetask = jQuery(this).serialize();

url: "/wp-admin/admin-ajax.php",
data: completetask,
error: function(errorThrown){
return false;


Form Code

<form method="post" id="completetask_<?php echo $task_id; ?>">
<input type="hidden" name="program_id" id="program_id" value="<?php echo $program_id; ?>"/>
<input type="hidden" name="session_id" id="session_id" value="<?php echo $session_id; ?>"/>
<input type="hidden" name="task_id" id="task_id" value="<?php echo $task_id; ?>"/>
<input type="hidden" name="action" value="completeTask"/>

<input class="program_task_submit_no program_task_submit_no_<?php echo $task_id; ?>" type="submit" value="COMPLETE TASK"/>