From 815c7462bbc4848939aa53cf375a0269d51b81fa Mon Sep 17 00:00:00 2001 From: wei <> Date: Sat, 2 Sep 2006 00:29:04 +0000 Subject: update validators --- framework/Web/Javascripts/js/debug/validator.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'framework/Web/Javascripts/js/debug/validator.js') 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 * visible 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 -- cgit v1.2.3