How to disable mouse and keyboard during a program load.

How to disable mouse and keyboard during a program load.

Hi,
in my application I would like to implement a function that disable all functions during a program load.
I mean, when I have a ajax request to execute a php program, I need to disable the mouse and the keyboard so the user can not click on menu bar, or on link, etc.

This is my ajax request

$.ajax({
                  type: 'POST',
                  url: "file.php",
                  data: {a:arg1, b:arg2},
  
                  beforeSend: function(xhr){
                     /* disable mouse and keyboard */
                      $("#wait").dialog({
                        "title": "RegistroOnWeb - Attesa programma -",
                        height: 140,
                        width: 430,   
                      })
                  },
 
                  success: function(msg){
                    $("#resulta").html(msg);           
                     /* enable mouse and keyboard */
                   },
})

Thanks in advance.

Tegatti