From f484625461b528b8fe66da45a63af88b2239bdcd Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 27 Apr 2006 08:44:04 +0000 Subject: Putting back Prado.WebUI.TDataTypeValidator javascript --- framework/Web/Javascripts/prado/validation3.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'framework') 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 DataType option. + * The following data types are supported: + * - Integer A 32-bit signed integer data type. + * - Float A double-precision floating point number data type. + * - Date A date data type. + * - String A string data type. + * For Date type, the option DateFormat + * 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; + } +}); -- cgit v1.2.3