From 371c6037c26c1385cc5874879d32744c26ac4ec1 Mon Sep 17 00:00:00 2001 From: Gabriel De Los Rios Date: Sun, 1 Dec 2024 13:11:24 -0300 Subject: [PATCH] feat(user): adds validation for changes before updating user profile --- app/static/js/update-user-info.js | 9 +++++++++ app/templates/users/index.html | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/static/js/update-user-info.js diff --git a/app/static/js/update-user-info.js b/app/static/js/update-user-info.js new file mode 100644 index 0000000..84a5e57 --- /dev/null +++ b/app/static/js/update-user-info.js @@ -0,0 +1,9 @@ +(() => { + 'use strict' + const personalInformationForm = document.querySelector('#personal-information-form'); + const personalInformationSubmitBtn = personalInformationForm.querySelector('button'); + personalInformationSubmitBtn.disabled = true; + personalInformationForm.oninput = function (){ + personalInformationSubmitBtn.disabled = false; + } +})() \ No newline at end of file diff --git a/app/templates/users/index.html b/app/templates/users/index.html index 63523fd..5003009 100644 --- a/app/templates/users/index.html +++ b/app/templates/users/index.html @@ -24,7 +24,7 @@ super() }} {% endif %} {% endwith %}
Personal information
-
+
+ {% endblock %}