Once a user has completed a form and hits the control to submit the data, the user needs to know that the form submission is in progress so they are not in danger of assuming the application has frozen, or an error has taken place with no notification.
Display an indicator that shows actual progress or at least that progress is being made.
Progress indicators let users know that the application is performing a function - e.g., submitting a form - and this function is in progress. It's important to show this to the user, even just after a short time.
Providing a progress indicator removes the concern that will arise for the user when they don't know that something is going on, what is going on, how long it will take, and are unable to take control of their circumstances.
More advanced progress indicators can also let the user know actual proportionate progress, estimated time to completion, offer further details concerning what is going on, and also offers an affordance to allow the user to cancel the operation. These extra features should be implemented whenever possible, as they provide much more transparency into the processing, which gives the user some control over the situation should they change their minds.
code here
There are a handful of common bits of feedback and control you can provide with progress indicators. As a general rule, the more, meaningful feedback you can provide, the better:
Most important of all, don't freeze up the UI or provide no indication that the solution is doing the processing requested. That leaves the user hanging and leads to great confusion and frustration and a poor user experience overall.