From: Dobrica Pavlinusic Date: Mon, 8 Nov 2010 19:34:35 +0000 (+0100) Subject: added max_length validator for summary fields X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=b2b99ab78cc40be41ba43d1b11dcca37626e69ba;hp=ae2c86229c1cd652560d81af023d07a3a53e0ab1;p=angular-mojolicious.git added max_length validator for summary fields --- diff --git a/templates/conference/Registration.html.ep b/templates/conference/Registration.html.ep index 2bb1f1b..6d9e66b 100644 --- a/templates/conference/Registration.html.ep +++ b/templates/conference/Registration.html.ep @@ -85,6 +85,11 @@ console.debug('save_symposium', self.symposium ); }, }; +angular.validator.max_length = function(input, len) { + var ok = input.length <= len; +console.debug( 'max_length', ok, input.length, len ); + return ok ? '' : 'must be shorter than '+len+' characters'; +} @@ -339,7 +344,7 @@ input.ng-validation-error { Add another organizer - +
    @@ -372,7 +377,7 @@ input.ng-validation-error { - +
{{registration.symposium.work_nr}}. {{registration.work.title}} has been submited successfully.