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();
}
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>
| What this info useful to you? You can donate to say thanks |
Add a comment
Sign in to add a comment