From d188bc02a9ff357465fc926fe0b3f0a45465d1a5 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Mon, 23 Feb 2015 14:45:08 +0200 Subject: util.js: input_validation__password() --- src/client/util.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/client/util.js') diff --git a/src/client/util.js b/src/client/util.js index a041c813..ca644fed 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -74,6 +74,15 @@ define(['jquery'], function($) { }); } + function input_validation__password(password_first, password_second) { + if (password_first != password_second) { + throw { message: 'passwords do not match' } + } + if (password_first.length < 8) { + throw { message: 'password too short - must be at least 8 charachters long' } + } + } + return { assert: assert, set_from_array: set_from_array, @@ -82,5 +91,6 @@ define(['jquery'], function($) { array_diff: array_diff, getParameterByName: getParameterByName, form_common__rest_post: form_common__rest_post, + input_validation__password: input_validation__password, }; }); -- cgit v1.3.1