diff options
author | wei <> | 2006-04-27 08:44:04 +0000 |
---|---|---|
committer | wei <> | 2006-04-27 08:44:04 +0000 |
commit | f484625461b528b8fe66da45a63af88b2239bdcd (patch) | |
tree | d8c245a25eb1d7779fb073870d4449c4b075a2c4 /framework | |
parent | 4aa1f46fcb508271b09cb5736d8bd0ef7206941d (diff) |
Putting back Prado.WebUI.TDataTypeValidator javascript
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Web/Javascripts/prado/validation3.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js index 615200dc..3ed31744 100644 --- a/framework/Web/Javascripts/prado/validation3.js +++ b/framework/Web/Javascripts/prado/validation3.js @@ -1189,5 +1189,25 @@ Prado.WebUI.TListControlValidator = Class.extend(Prado.WebUI.TBaseValidator, });
-
+/**
+ * TDataTypeValidator verifies if the input data is of the type specified
+ * by <tt>DataType</tt> option.
+ * The following data types are supported:
+ * - <b>Integer</b> A 32-bit signed integer data type.
+ * - <b>Float</b> A double-precision floating point number data type.
+ * - <b>Date</b> A date data type.
+ * - <b>String</b> A string data type.
+ * For <b>Date</b> type, the option <tt>DateFormat</tt>
+ * will be used to determine how to parse the date string.
+ */
+Prado.WebUI.TDataTypeValidator = Class.extend(Prado.WebUI.TBaseValidator,
+{
+ evaluateIsValid : function()
+ {
+ var value = this.getValidationValue();
+ if(value.length <= 0)
+ return true;
+ return this.convert(this.options.DataType, value) != null;
+ }
+});
|