From ad3e1f7ea48d2bf5e55dd5b10d408d0d9551b249 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 26 Jan 2019 18:18:59 -0800 Subject: [PATCH] Validat email in the pattern of 'string@string.string' --- front/static/js/signupPage.js | 10 +++++++++- front/static/signup.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/front/static/js/signupPage.js b/front/static/js/signupPage.js index 5fef862..0055cce 100644 --- a/front/static/js/signupPage.js +++ b/front/static/js/signupPage.js @@ -9,4 +9,12 @@ function validatePassword(){ } } password.onchange = validatePassword; -confirm_password.onkeyup = validatePassword; \ No newline at end of file +confirm_password.onkeyup = validatePassword; + +function validateEmail(email) +{ + if(email.validity.patternMismatch) + email.setCustomValidity('Please input correct email'); + else + email.setCustomValidity(''); +} \ No newline at end of file diff --git a/front/static/signup.html b/front/static/signup.html index 070addd..6172223 100644 --- a/front/static/signup.html +++ b/front/static/signup.html @@ -29,7 +29,7 @@
- +