Closed. This question needs
debugging details. It is not currently accepting answers.
Answer
Solution:
The error in the code is that the customized alert box does not pop up when the form is successfully submitted. To fix this, you can add the following code to the end of the PHP script:
echo '<script type="text/javascript">alert("Your form has been successfully submitted!");</script>';
Source