summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js28
1 files changed, 22 insertions, 6 deletions
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js
index ffdbe7b0..45e9aa43 100644
--- a/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -186,14 +186,25 @@ Prado.ValidationManager.prototype =
*/
initialize : function(options)
{
- this.validators = []; // list of validators
- this.summaries = []; // validation summaries
- this.groups = []; // validation groups
- this.options = {};
-
- this.options = options;
if(!Prado.Validation.managers[options.FormID])
+ {
+ this.validators = []; // list of validators
+ this.summaries = []; // validation summaries
+ this.groups = []; // validation groups
+ this.options = {};
+
+ this.options = options;
+
Prado.Validation.managers[options.FormID] = this;
+ }
+ else
+ {
+ var manager = Prado.Validation.managers[options.FormID];
+ this.validators = manager.validators;
+ this.summaries = manager.summaries;
+ this.groups = manager.groups;
+ this.options = manager.options;
+ }
},
/**
@@ -286,6 +297,11 @@ Prado.ValidationManager.prototype =
*/
addValidator : function(validator)
{
+ // Erase any existing validator with same options
+ this.validators = this.validators.reject(function(v)
+ {
+ return (v.options.ID==validator.options.ID);
+ });
this.validators.push(validator);
if(validator.group && !this.groups.include(validator.group))
this.groups.push(validator.group);