diff options
author | wei <> | 2006-09-02 00:29:04 +0000 |
---|---|---|
committer | wei <> | 2006-09-02 00:29:04 +0000 |
commit | 815c7462bbc4848939aa53cf375a0269d51b81fa (patch) | |
tree | 6fa4977ce42f8e28fa71fe32c1e9d07d43d01797 /framework/Web/Javascripts/js/debug | |
parent | 215c1294d356e35b7717b05892a45b9f0b76a847 (diff) |
update validators
Diffstat (limited to 'framework/Web/Javascripts/js/debug')
-rw-r--r-- | framework/Web/Javascripts/js/debug/validator.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/framework/Web/Javascripts/js/debug/validator.js b/framework/Web/Javascripts/js/debug/validator.js index 7a963f82..d0293cbd 100644 --- a/framework/Web/Javascripts/js/debug/validator.js +++ b/framework/Web/Javascripts/js/debug/validator.js @@ -593,22 +593,25 @@ Prado.WebUI.TBaseValidator.prototype = * element. Updating the validator control will set the validator
* <tt>visible</tt> property to true.
*/
- updateControl: function()
+ updateControl: function(focus)
{
+ this.refreshControlAndMessage();
+
+ if(this.options.FocusOnError && !this.isValid )
+ Prado.Element.focus(this.options.FocusElementID);
+ },
+
+ refreshControlAndMessage : function()
+ {
+ this.visible = true;
if(this.message)
{
if(this.options.Display == "Dynamic")
this.isValid ? this.message.hide() : this.message.show();
this.message.style.visibility = this.isValid ? "hidden" : "visible";
}
-
if(this.control)
this.updateControlCssClass(this.control, this.isValid);
-
- if(this.options.FocusOnError && !this.isValid)
- Prado.Element.focus(this.options.FocusElementID);
-
- this.visible = true;
},
/**
@@ -659,9 +662,7 @@ Prado.WebUI.TBaseValidator.prototype = {
if(typeof(this.options.OnSuccess) == "function")
{
- this.visible = true;
- this.message.style.visibility = "visible";
- this.updateControlCssClass(this.control, this.isValid);
+ this.refreshControlAndMessage();
this.options.OnSuccess(this, invoker);
}
else
@@ -671,9 +672,7 @@ Prado.WebUI.TBaseValidator.prototype = {
if(typeof(this.options.OnError) == "function")
{
- this.visible = true;
- this.message.style.visibility = "visible";
- this.updateControlCssClass(this.control, this.isValid);
+ this.refreshControlAndMessage();
this.options.OnError(this, invoker);
}
else
|