diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecord.php | 2 | ||||
-rw-r--r-- | framework/Web/Javascripts/source/prado/validator/validation3.js | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index a66ab21c..b6b19d13 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -625,4 +625,4 @@ abstract class TActiveRecord extends TComponent $this->raiseEvent('OnExecuteCommand', $this, $param); } } -?> +?>
\ No newline at end of file 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;
},
|