The thing is that i had same problem/question while ago and this is the way to go.
In my apps, i do all form submissions via ajax, it is way better for the app itself (less processing) and for the client because while the app is doing the processing i can show a nice message to client letting him know the application is doing some work and he needs to wait (also i lock the form to prevent double submissions)
You can take a look at the MessageStack extension, this is one of the reasons i created it, it simplifies my workflow very much, basically in my controller i have something like:
As you see from my model i return the messageStack object itself, which will call toJson() in the controller which will cause the application to end and print all the stored data in a json format.
Having in mind the request has been made via ajax, this response can now be read in the callback of the ajax call and we can use returned variables as we want.(ie window.location.href=object.redirect or show the obj.msg to the client, because this contains an error message which needs to be seen)
Anyway, there are other ways to do all this stuff, but this is mine and it works perfectly
You also don’t need AJAX for that. You can disable form submit button in it’s onClick and this will happen as first phase, before form will be submited. Many banks does the thing this way.