Simple way to prevent JS button double-clicking

Simply add a disable setting to your onclick call before the function you're calling.
JavaScript

What to add before.

this.disabled=true; 

Example

<button type="button" class="btn btn-outline-danger" onclick="this.disabled=true; undoCheckout('BKDZ8TKD');">undo</button>

Written by fbrefere001

Posted by fbrefere001 on Tuesday November 3, 2026