In a company CRUD for example, we often find extensive forms with many fields and probably the user will forget or fill in some incorrectly, so by giving submit in the form what is the best way to save and rewrite the typed data if there is an error, so you do not need to fill out the form again?
I think of some solutions:
-
Use session variables to store all typed data and to rewrite them check if the variable exists and then writes it to the document.
-
Do all the submit by Ajax, do not reload the page by giving submit, but rather submit the data for validation. (but it seems to me that the application loses performance).
-
Validate everything with Javascript, although some fields will need to query the database to be validated.
These are the ways that I can imagine, but I do not know which would be the most profitable for the agility of the software, and if there are other ways. Which would be the best and would give you less headache?