diff --git a/public/static/js/mapguesser.js b/public/static/js/mapguesser.js index 89a79a9..6e665c1 100644 --- a/public/static/js/mapguesser.js +++ b/public/static/js/mapguesser.js @@ -183,12 +183,23 @@ var MapGuesser = { document.getElementById('cover').style.visibility = 'hidden'; }, - observeInput: function (input, buttonToToggle) { - if (input.defaultValue !== input.value) { - buttonToToggle.disabled = false; - } else { - buttonToToggle.disabled = true; + observeInput: function (form, observedInputs) { + var anyChanged = false; + + for (var i = 0; i < observedInputs.length; i++) { + var input = form.elements[observedInputs[i]]; + if (input.type === 'checkbox') { + if (input.defaultChecked !== input.checked) { + anyChanged = true; + } + } else { + if (input.defaultValue !== input.value) { + anyChanged = true; + } + } } + + form.elements['submit_button'].disabled = !anyChanged; }, observeInputsInForm: function (form, observedInputs) { @@ -199,19 +210,19 @@ var MapGuesser = { case 'INPUT': case 'TEXTAREA': input.oninput = function () { - MapGuesser.observeInput(this, form.elements.submit); + MapGuesser.observeInput(form, observedInputs); }; break; case 'SELECT': input.onchange = function () { - MapGuesser.observeInput(this, form.elements.submit); + MapGuesser.observeInput(form, observedInputs); }; break; } } form.onreset = function () { - form.elements.submit.disabled = true; + form.elements['submit_button'].disabled = true; } } }; diff --git a/views/account/account.php b/views/account/account.php index a2a31f1..e21ae64 100644 --- a/views/account/account.php +++ b/views/account/account.php @@ -29,7 +29,7 @@

- +

diff --git a/views/account/delete.php b/views/account/delete.php index 864d3d5..60689fd 100644 --- a/views/account/delete.php +++ b/views/account/delete.php @@ -26,7 +26,7 @@

- Cancel