From 68a060d80b8eb66f0949dfb0d50a6f00bca1fb5e Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Fri, 9 Jan 2015 16:28:21 -0800 Subject: [PATCH] UI-994: Add regex rule for the validation --- js/lib/monster.ui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/lib/monster.ui.js b/js/lib/monster.ui.js index 0a6686b51..b0e78ee57 100644 --- a/js/lib/monster.ui.js +++ b/js/lib/monster.ui.js @@ -757,6 +757,11 @@ define(function(require){ else return true; }, localization.customRules['checkList']); + // Adding advanced custom rules + $.validator.addMethod('regex', function(value, element, regexpr) { + return regexpr.test(value); + }); + this.customValidationInitialized = true; },