Programming Tips - How can I programatically submit an HTML form?

Date: 2009nov9 Language: javaScript Q. How can I programatically submit an HTML form? A. Call the form's submit method. If you only have one form:
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() { var obj; obj = document.getElementById('the_second_form'); obj.submit(); } </script>