JS - form submission canceled because the form is not connected