I am programmer myself and unless Javascript works too differently from what I am used to, the solution would be 2 lines of code.
Disabling the "Find Battle" button as soon as it is clicked and enabling it again (when the battle is finished, 2 seconds later, after the server responded with a...