Javascript examples for DOM Event:onsubmit
The onsubmit event occurs when a form is submitted.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Supported HTML tags: | <form> |
<!DOCTYPE html> <html> <body> <form action="/action_page.php" onsubmit="myFunction()"> Enter name: <input type="text" name="fname"> <input type="submit" value="Submit"> </form>/*from w ww .java 2 s. co m*/ <script> function myFunction() { console.log("The form was submitted"); } </script> </body> </html>