Fix the order of handlers: detect submit, and then submit form.