Execute a JavaScript when a form is submitted:
![]()
The onsubmit event attribute is supported in all major browsers.
The onsubmit attribute fires when a form is submitted.
The onsubmit attribute is only used within: <form>.
None.
| Value | Description |
|---|---|
| script | The script to be run on onsubmit |
HTML Event Attributes
Your message has been sent to W3Schools.