aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js3
-rw-r--r--web/js/validation_rules.js8
2 files changed, 10 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index a3ac5b71a..0aa01e483 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -285,6 +285,9 @@ $.extend(fixmystreet.set_up, {
if (jQuery.validator) {
jQuery.validator.addMethod('validCategory', function(value, element) {
return this.optional(element) || value != '-- Pick a category --'; }, translation_strings.category );
+ jQuery.validator.addMethod('js-password-validate', function(value, element) {
+ return !value || value.length >= fixmystreet.password_minimum_length;
+ }, translation_strings.password_register.short);
}
var submitted = false;
diff --git a/web/js/validation_rules.js b/web/js/validation_rules.js
index 5295a53ca..e6d745336 100644
--- a/web/js/validation_rules.js
+++ b/web/js/validation_rules.js
@@ -1,5 +1,11 @@
validation_rules = {
title: { required: true },
detail: { required: true },
- update: { required: true }
+ update: { required: true },
+ password_register: {
+ remote: {
+ url: '/auth/common_password',
+ type: 'post'
+ }
+ }
};