diff --git a/bikeshop_project/registration/templates/edit_member_form.html b/bikeshop_project/registration/templates/edit_member_form.html index 61064b1..50d2bc1 100644 --- a/bikeshop_project/registration/templates/edit_member_form.html +++ b/bikeshop_project/registration/templates/edit_member_form.html @@ -4,7 +4,8 @@ {% block scripts %} {% endblock %} @@ -220,7 +231,7 @@
-
diff --git a/bikeshop_project/registration/templates/member_form.html b/bikeshop_project/registration/templates/member_form.html index ffa6436..f04f595 100644 --- a/bikeshop_project/registration/templates/member_form.html +++ b/bikeshop_project/registration/templates/member_form.html @@ -25,6 +25,15 @@ var waiverCheckBox = document.getElementById('{{ form.waiver_substitute.id_for_label }}'); var submitButton = document.getElementById('submit'); + var form = document.getElementsByTagName('form')[0]; + var inputs = Array.prototype.slice.call(document.getElementsByTagName('input')); + + for (var anInput of inputs) { + anInput.addEventListener('change', function() { + submitButton.disabled = !form.checkValidity() + }) + } + var requiredCheckboxes = function() { return waiverCheckBox.checked; };