after many trials, i found that changing the the form data section to $(this).serialize worked instead of $('form#completetaskform').serialize(). Not sure why but this worked. Thank you.
$("form#completetaskform").submit(function(){
$.ajax ({
type:"POST",
url:"Functions/completeTask.php",
data: $(this).serialize(),
success: function(msg){
notifyTaskCompleted();
location.reload();
},
});
return false;
});