From c2194a4c0aac3faab4598c21f1ea49e2cd2fefa1 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 13 Jan 2019 17:48:06 -0800 Subject: [PATCH] Separate javascript from html file --- front/static/signup.html | 15 +-------------- front/static/signupPage.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 front/static/signupPage.js diff --git a/front/static/signup.html b/front/static/signup.html index a8905a4..4db8d4b 100644 --- a/front/static/signup.html +++ b/front/static/signup.html @@ -18,18 +18,5 @@ Return to main menu - + \ No newline at end of file diff --git a/front/static/signupPage.js b/front/static/signupPage.js new file mode 100644 index 0000000..be8ca6c --- /dev/null +++ b/front/static/signupPage.js @@ -0,0 +1,12 @@ +var password = document.getElementById("password"); +var confirm_password = document.getElementById("confirmPassword"); +function validatePassword(){ + if(password.value != confirm_password.value) { + confirm_password.setCustomValidity("Passwords Don't Match"); + } + else { + confirm_password.setCustomValidity(''); + } +} +password.onchange = validatePassword; +confirm_password.onkeyup = validatePassword; \ No newline at end of file