Ajax and PHP
Posted on 2017-03-13
I am new to AJax and have a question concerning data validation. I have seen many examples where the Ajax url is redirecting to another page for data validation and examples where it is not redirected but stays on same input page displayed to users.
I realized a lot of factors can play into this but I just want it simple.
My requirements are 1. the user input needs to remain on the page 2. if errors, a dialog or alert is displayed to the user and then the user can then correct the errors. 3. if there are no errors, I want to display a spinner while processing the input before redirecting.
Which method is the best for these requirements? Am I correct that the <form></form> will not have the "method= post" since the Ajax is handling it? The pages will be called from main page that will be using tabs. The input page will have some jQeury plugins that seem to have problem when the page is refreshed by the old way of <form method=post>.