2

There are several occasions that users try to click a button multiple times in a row for whatever reason.

I want to disable or hide a button for a few seconds after it is clicked, so that it will not be clicked again temporarily.

By buttons here I mean every button in Odoo that is possible to implement this feature.

Is there a solution to achieve such mechanism?

If there is no system-wide implementation for this, a button-specific method will suffice.

holydragon
  • 6,158
  • 6
  • 39
  • 62
  • 1
    Very good question, but i fear it's a lifetime quest to achieve it. Usually i would open up an issue on github for it and ping the frontend team, to atleast get a hint if it's possible and where to start the journey ;-) – CZoellner Jul 27 '22 at 11:09

1 Answers1

0
    $(document).ready(function () {
         $("#yourbutton").on('click', function (event) {  
               event.preventDefault();
               //your js code
               //to disable the button:
               $(this).prop('disabled', true);
         });
    });
sylvain
  • 853
  • 1
  • 7
  • 20