That progress bar would have to be displayed by the browser; you'd want to display something which blocks the user from clicking on the HTML displayed in the browser until it receives a response.
Of course you'd have to do that in JavaScript so I'll move this
thread to the JavaScript forum for you.
I remember doing this several years ago -- one necessary condition is that your request has to be sent via AJAX, otherwise it's not your code which is waiting for the response. I can't remember in detail how I did it but googling
javascript progress bar might well lead you to solutions.