My last question was not clear so I am posting it with all clarification here. In the code below I want to show error messages using jQuery for registration form errors. Problem here is this code simply inserts data into database without checking any errors or showing error message and redirects to login page. So where I am going wrong? My last question was not clear so I am posting