Call to preventDefault should be done as soon as possible
I just get this strange behaviour when debugging. After clicking on a modal submit button, the application is reloaded.
This is because the call to preventDefault was done at the end of the callback method and there was an exception raised in the callback code before.
I think for robustness, we should call preventDefault on the first line of the callback.