5 Replies Latest reply on Apr 8, 2008 12:10 PM by Garyl Woolworth

    Prepopulate DateField with Today's Date

    kdennis4 Level 1
      Below is the code I currently have:

      import mx.controls.*;

      private function retrieveDate():void {
      requestDate.text += new Date();
      }

      <mx:FormItem label="Request Date:" fontFamily="Gotham" fontWeight="bold" fontSize="12" x="39" y="68" width="228">
      <mx:DateField id="requestDate" text="{retrieveDate()}" width="114" showToday="true" enabled="true"/>
      </mx:FormItem>

      I know it's got to be something simple I'm missing. Thanks in advance for solutions!