I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Unisciti a noi e traducilo tu stesso.
Puoi anche consultare l’articolo in English (US).

The onsubmit property of the GlobalEventHandlers mixin is an EventHandler that processes submit events.


window.onsubmit = funcRef;


  • funcRef is a reference to a function.


function reg() {
  window.onsubmit = hit;
function hit() {

<body onload="reg();">
  <input type="submit" value="submit" />
<div id="d"> </div>


The submit event is raised when the user clicks a submit button in a form (<input type="submit"/>). The submit event is not raised when the user calls form.submit() function directly.


Specification Status Comment
HTML Living Standard
The definition of 'onsubmit' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes


Full support  
Full support

Tag del documento e collaboratori

Hanno collaborato alla realizzazione di questa pagina: mfluehr, fscholz, erikadoyle, jpmedley, DmitryK, cvrebert, Sebastianz, teoli, kosvrouvas, kscarfone, Sheppy, ziyunfei, Jabez, Teymour, Callek, alecananian
Ultima modifica di: mfluehr,