User:PiaCarrot/monobook.js

var submitchecker_buttonclicked = false;

function install_submitchecker { var f = document.getElementById("editform"); if(f) { var inputs = f.getElementsByTagName("input"); for(var i = 0; i < inputs.length; ++i) if(inputs[i].type == "submit") inputs[i].onclick = submitchecker_nocheck; f.onsubmit = submitchecker; } } function submitchecker { if(submitchecker_buttonclicked) return true; return confirm("Are you sure you want to submit your changes?"); } function submitchecker_nocheck { submitchecker_buttonclicked = true; return true; }

window.onload = install_submitchecker;