diff options
author | rojaro <> | 2009-09-30 17:49:10 +0000 |
---|---|---|
committer | rojaro <> | 2009-09-30 17:49:10 +0000 |
commit | 3199d1e928621f245b2c5d9ceea6b77090c5edeb (patch) | |
tree | cd36768a424d77be0838eadd0392c0f8a2b605cb /framework | |
parent | d76123127139a7cb013a0e4c17a63eb8aab57e3e (diff) |
merged patch which fixes an inconsistency in TRegularExpressionValidator's client side validation found and fixed by E.Letard (see comments in #80)
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/Javascripts/source/prado/validator/validation3.js | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js index 18b1d0c2..ed9493be 100644 --- a/framework/Web/Javascripts/source/prado/validator/validation3.js +++ b/framework/Web/Javascripts/source/prado/validator/validation3.js @@ -1103,7 +1103,7 @@ Prado.WebUI.TBaseValidator.prototype = * @param {optional element} control - Control to get value from (default: this.control)
* @return Control value to validate
*/
- getValidationValue : function(control)
+ getRawValidationValue : function(control)
{
if(!control)
control = this.control
@@ -1131,7 +1131,7 @@ Prado.WebUI.TBaseValidator.prototype = case 'THtmlArea':
if(typeof tinyMCE != "undefined")
tinyMCE.triggerSave();
- return this.trim($F(control));
+ return $F(control);
case 'TRadioButton':
if(this.options.GroupName)
return this.getRadioButtonGroupValue();
@@ -1139,9 +1139,26 @@ Prado.WebUI.TBaseValidator.prototype = if(this.isListControlType())
return this.getFirstSelectedListValue();
else
- return this.trim($F(control));
+ return $F(control);
}
},
+
+ /**
+ * Get a trimmed value that should be validated.
+ * The ControlType property comes from TBaseValidator::getClientControlClass()
+ * Be sure to update the TBaseValidator::$_clientClass if new cases are added.
+ * @function {mixed} ?
+ * @param {optional element} control - Control to get value fron (default: this.control)
+ * @return Control value to validate
+ */
+ getValidationValue : function(control)
+ {
+ value = this.getRawValidationValue(control);
+ if(Object.isString(value))
+ return this.trim(value);
+ else
+ return value;
+ },
/**
* Get value of radio button group
@@ -1685,7 +1702,7 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato */
evaluateIsValid : function()
{
- var value = this.getValidationValue();
+ var value = this.getRawValidationValue();
if (value.length <= 0)
return true;
|