Answers for "button onsubmit"

3

onsubmit in html

<form onsubmit="myFunction()">
  Enter name: <input type="text">
  <input type="submit">
</form>

<script>
function myFunction() {
  alert("The form was submitted");
}
</script>
Posted by: Guest on May-21-2021
0

html submit form onclick

var form = document.getElementById("form-id");

document.getElementById("your-id").addEventListener("click", function () {
  form.submit();
});
Posted by: Guest on July-08-2020
0

html form onsubmit

This can be used for buttons
Posted by: Guest on August-16-2021

Browse Popular Code Answers by Language