Well first, you have a form that calls the AJAX code.
And you have the AJAX code.
And then you have the PHP page that the AJAX code calls (checkconfirm.php).
These three parts make up the code.
Without all three parts, you can't make the code work.
And I wouldn't know how to help unless I know what's in all three parts.
You are showing two of the parts; The AJAX code and checkconfirm.php.
In order to finish the AJAX code, I would need to see the form.