Added the JS handling to prevent duplicate submissions of a form