function submitTheForm() { if (document.forms.length == 0) return false; document.forms[0].submit(); return true; }If you have multiple forms:
<form id=the_second_form> </form> <script> function submitSecondForm() { let obj = document.getElementById('the_second_form'); obj.submit(); } </script>