From 83796d4e7fcc412c435a37992f9827ac0f4ec4af Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 20 Nov 2015 14:12:52 -0500 Subject: extend w/ prototype --- StoneIsland/www/js/lib/account/ProfileView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'StoneIsland/www/js/lib/account/ProfileView.js') diff --git a/StoneIsland/www/js/lib/account/ProfileView.js b/StoneIsland/www/js/lib/account/ProfileView.js index f03572dc..3c37c835 100644 --- a/StoneIsland/www/js/lib/account/ProfileView.js +++ b/StoneIsland/www/js/lib/account/ProfileView.js @@ -23,8 +23,9 @@ var ProfileView = FormView.extend({ }, validate_fields: function(errors){ - if (data.Password && ! data.Password2) { errors.push("Password2", "Please enter your new password.") } - if (data.Password && data.Password.length < 7) { errors.push("Password", "Password must be 7 characters or more.") } + if (! data.CurrentPassword && data.NewPassword) { errors.push("CurrentPassword", "Please enter your current password.") } + if (data.CurrentPassword && ! data.NewPassword) { errors.push("NewPassword", "Please enter your new password.") } + if (data.NewPassword && data.NewPassword.length < 7) { errors.push("CurrentPassword", "New password must be 7 characters or more.") } }, success: function(data){ -- cgit v1.2.3-70-g09d2