1 Reply Latest reply on Oct 22, 2009 8:18 AM by msakrejda

    Is there a simple way to validate time?

    lee704 Level 1

      I need to validate a TextInput field for time.  I can validate for date by using the following code:

       

       

       

       

      <mx:DateValidator id="dateVal"
            source="{tiDate}"
            property="text"
            inputFormat="mm/dd/yyyy"/>

       

      Obviously, with this code, a value of 10/22/2009 passes validation.

       

      What I need to do is validate a value of 10/22/2009 1:15:00 AM.  Assuming I use similar code as above, I thought the code below would work:

       

      <mx:DateValidator id="dateVal"
            source="{tiDate}"
            property="text"
            inputFormat="mm/dd/yyyy l:nn:ss a"/>

       

      A value entered of 10/22/2009 1:15:00 AM does not pass validation.  Can anyone suggest why it is not working?