Prevent accidentally close the form

When user start process in tasklist, and fill data in the form,
they will usually click or highlighted to the area which is out of the form,
so the form is closed and user required to input all the information again.

Is there any way to prevent this action?

Thank you.


Have a look at below post


It works just fine, thanks a lot!