diff options
author | wei <> | 2007-05-10 03:08:51 +0000 |
---|---|---|
committer | wei <> | 2007-05-10 03:08:51 +0000 |
commit | 0301d3a65dec4d4b35d3fe9bfbe33728a4d05f48 (patch) | |
tree | 769b232428647b411cfe8fac8977045dfb9f803f /framework/Web | |
parent | cb20cf164464b87e76448a8ed4f9b1cb1b1651d4 (diff) |
Fixed #617
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/Javascripts/source/prado/validator/validation3.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js index 28028d6d..b7793d49 100644 --- a/framework/Web/Javascripts/source/prado/validator/validation3.js +++ b/framework/Web/Javascripts/source/prado/validator/validation3.js @@ -215,11 +215,23 @@ Prado.ValidationManager.prototype = {
var partition = this.validatorPartition(group);
var valid = partition[0].invoke('validate', source).all();
+ this.focusOnError(partition[0]);
partition[1].invoke('hide');
this.updateSummary(group, true);
return valid;
},
+ /**
+ * Focus on the first validator that is invalid and options.FocusOnError is true.
+ */
+ focusOnError : function(validators)
+ {
+ for(var i = 0; i < validators.length; i++)
+ {
+ if(!validators[i].isValid && validators[i].options.FocusOnError)
+ return Prado.Element.focus(validators[i].options.FocusElementID);
+ }
+ },
/**
* @return array[0] validators belong to a group if group is given, otherwise validators
@@ -602,8 +614,8 @@ Prado.WebUI.TBaseValidator.prototype = {
this.refreshControlAndMessage();
- if(this.options.FocusOnError && !this.isValid )
- Prado.Element.focus(this.options.FocusElementID);
+ //if(this.options.FocusOnError && !this.isValid )
+ // Prado.Element.focus(this.options.FocusElementID);
this.visible = true;
},
|