Use delegated events for 'disable-on-click' button handler

There's a button handler that disables the button to help against duplicate
submissions. But in the previous form, the event handler got assigned
when the page was ready and would only work for buttons that were
present at that time.
Now, it uses jQuery's delegated events to ensure that even if a form
gets reloaded via AJAX, it works as expected.

Closes #1039.