Hello,

var dateValidator = function(value) {

   var isValidDate = function(value){
      //if check if value is a valide date return true;
      else return false;
   }

   return (value == null || isValidDate (value));
}



chrisch wrote
> I'm trying to validate a DateField with a custom validation function that
> checks if the value of the field is parsed correctly into a Date Object
> and is not null. Here is my validation function:
> 
> var dateValidator = function(value) {
>  return (value != null);
> }
> 
> That works fine so far. The problem is now that the field is not required,
> the user is allowed to leave it empty. But in this case the value is also
> null and I cannot determine if the field was intentionally left blank or
> if the parsing to a date object has failed, because the user has entered a
> bad string into the date field. 
> 
> Is there a way to validate it only if the user has entered something?





--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Validation-of-a-DateField-tp7587188p7587189.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to