From 8fa31a80cae0d00a14f1cb3aafaae20e504e46ad Mon Sep 17 00:00:00 2001 From: noraiz-anwar Date: Thu, 13 Apr 2017 15:34:08 +0500 Subject: [PATCH] Fix firefox issue for email field with extra whitespaces --- lms/static/js/student_account/views/FormView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lms/static/js/student_account/views/FormView.js b/lms/static/js/student_account/views/FormView.js index 719288d4bd..d164904157 100644 --- a/lms/static/js/student_account/views/FormView.js +++ b/lms/static/js/student_account/views/FormView.js @@ -157,6 +157,12 @@ $label = $form.find('label[for=' + $el.attr('id') + ']'); key = $el.attr('name') || false; + // Due to a bug in firefox, whitespaces in email type field are not removed. + // TODO: Remove this code once firefox bug is resolved. + if (key === 'email') { + $el.val($el.val().trim()); + } + if (key) { test = this.validate(elements[i]); if (test.isValid) {