Run 'Spinner' on Aras modal dialog

Hi Team,

How to  run 'Spinner' on modal dialog to prevent user from closing modal dialog.

-->When user click on 'Submit; button we should run a spinner which stops user from closing the dialog until something happened in the background.

How can we achieve this.

Thanks in advance.