Added a javascript function to overwrite a submit to make the form submission to work