How to Submit a Form Using JavaScript
Suppose you want to submit a form when the user clicks on a hyperlink. The code below shows how to do it.
<form name="myform" action="handle-data.php">
Search: <input type='text' name='query'>
<A href="javascript: submitform()">Search</A>
</form>
<SCRIPT language="JavaScript">
function submitform()
{
document.myform.submit();
}
</SCRIPT>