diff --git a/mibpov.js b/mibpov.js index 48c9dcc..208fa4d 100644 --- a/mibpov.js +++ b/mibpov.js @@ -2452,6 +2452,16 @@ exportHeaderLink.onclick = function() { toggleConfigSectionDisplay(this, exportContainer); } +/* Prevent forms from submitting */ +function disableFormSubmission() { + let elements = document.querySelectorAll("form"); + for (let elem of elements) { + elem.onsubmit = function() { + return false; + } + } +} + /* Load events */ window.addEventListener("load", initBiomeColorSelectors); @@ -2464,3 +2474,4 @@ window.addEventListener("load", updateWidgetStates); window.addEventListener("load", updateAltitudeText); window.addEventListener("load", unhideContent); window.addEventListener("load", fitCanvasInBody); +window.addEventListener("load", disableFormSubmission);