HTML CSS Javascript jQuery AJAX PHP Java MORE

How to submit form using Javascript

		<!DOCTYPE html>
		<html>
		<body>

		<p>Enter data and submit the form.</p>

		<form id="myForm" action="post.php">
		  First name: <input type="text" name="fname"><br>
		  Last name: <input type="text" name="lname"><br><br>
		  <input type="button" onclick="submitForm()" value="Submit form">
		</form>

		<script>
		function submitForm() {
		  document.getElementById(“myForm").submit();

		}
		</script>

		</body>
		</html>
		
		

Run it yourself