GlobalEventHandlers.onsubmit
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Manejador de eventos del evento submit para el objeto window.
Sintaxis
window.onsubmit = funcRef;
Parametros
funcRef
es una referencia a una función.
Ejemplo
<html> <script> function reg() { window.captureEvents(Event.SUBMIT); window.onsubmit = hit; } function hit() { console.log('hit'); } </script> <body onload="reg();"> <form> <input type="submit" value="submit" /> </form> <div id="d"> </div> </body> </html>
Notas
El evento submit se genera cuando el usuario hace click en el boton submit en un formulario (<input type="submit"/>
).
El evento submit no se genera cuando el usuario llama a la función form.submit()
directamente.
Especificaciones
Specification |
---|
HTML # event-submit |
HTML # handler-onsubmit |
Browser Compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
submit event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.