html form on submit function code example
Example 1: html submit form onclick
var form = document.getElementById("form-id");
document.getElementById("your-id").addEventListener("click", function () {
form.submit();
});
Example 2: how to use form on submit in html
<form onsubmit="myFunction()">
Enter name: <input type="text">
<input type="submit">
</form>