I want to send an AJAX request to server, while in the server the following operations happen in the following order:
Validation
Sanitising inputs
Inserting data to DB
Can I show user the current operation status of AJAX request?
For example: When the request has finished validating user inputs (in backend) I want to show user on front-end saying, “validating finished, and sanitising process is running” and the same for the next processes.
It’s really not worth bothering to do this. You have to keep in mind that:
The server-side validation, sanitizing, and inserting to the DB should be so quick that it’s pointless to inform the user about this.
The vast majority of users probably wouldn’t understand the messages anyway, nor would they care.
Having a UI that informs the user of the what is happening behind the scenes is only practical when you have long-running processes where the user will be kept waiting, and even then it’s mostly just to reassure them that something is happening and it’s not gotten stuck!