Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<p>Click the "Submit" button to submit the form.</p>
<form onsubmit="myFunction()" action="/action_page.php">
  Firstname: <input type="text" name="fname" value="Donald"><br>
  Lastname: <input type="text" name="lname" value="Duck"><br><br>
  <input type="submit" value="Submit">
</form>
<script>
function myFunction() {
  alert("The form will be submitted");
}
</script>
</body>
</html>