1 Reply Latest reply on Apr 16, 2008 10:15 AM by jinx82002

    Make DateField required with validation

      I need a DateField to be required so it shows an error if it gains focus and then loses focus without being set. I have seen some examples, but they didn't work when I tried them.
        • 1. Re: Make DateField required with validation
          Hey Izzy,
          You want something similar to this:

          <mx:DateValidator id="dateValidator" source="{myDate}" property="text" requiredFieldError="You must choose a date" />
          <mx:DateField id="myDate" focusOut="dateValidator.validate()" />

          Obviously you'd want to handle validation according to your app's rules. But that's one way to do it.