function to run when form is submit javascript code example Example: javascript submit form document.forms["myform"].submit();