I have a button that I would like to disable when the form submits to prevent the user submitting multiple times.
I have tried naively disabling the button with java
Disable the button at the very end of your submit handler. If the validation fails, it should return false before that.
However, the JavaScript approach is not something that can be relied upon, so you should have something to detect duplicates on the server as well.