how to disabled a button when press three times

Use Javascript, on the click event write in a new variable and count the click. If is equal with 3, then add the attribute to the button, that people can’t use this.

As simple example with the help of jQuery. I think jQuery is much better, is always active in the back end of WordPress. Copy the script, change the selector to your ID or class, that you identify the right input field, in a script and load it via hook, like load-{$page_hook} only on the page, there you will use this script.

jQuery( document ).ready( function( $ ) {

    var counter = 1,
        element="input.edit";

    $( element ).click( function(e) {
        counter ++;
        // for control debugging in console
        console.log( counter );
        if ( counter > 3 ) {
            $( element ).attr( 'disabled', true );
        }
    } )

} );