It was not doing anything when I submitted. So I moved the alert and redirect out of the success function in the ajax call like it was before