Fixed so the default action of closing the window on a form submission can be prevented using "preventDefault".