summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source
diff options
context:
space:
mode:
authortof <>2008-03-13 15:39:19 +0000
committertof <>2008-03-13 15:39:19 +0000
commite3a43f088e9e7ce3381168d7c8b9ad0592903148 (patch)
tree7062e7613d99d5b8128c620abb0653b69aea1d8e /framework/Web/Javascripts/source
parent8024b179ed3657b1e43e9684105a172a287700b9 (diff)
Fixed #769
Diffstat (limited to 'framework/Web/Javascripts/source')
-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);