We have a Datefield component with Editable = true
<mx:DateField id="startDate"
width="120"
editable="true"
formatString="MM/DD/YYYY"
selectableRange="{{rangeStart : new Date(2010,0,1), rangeEnd : new Date()}}"
showToday="true"
labelFunction="formatDate"
restrict="[0-9] '\/'" change="startDate_clickHandler(event)"
yearNavigationEnabled="true"
text="{}" tabIndex="15" />
The Calendar has everything we want (able to choose a valid date only after 01/01/2010). Now the issue is that if the user enters (Editable = true) an invalid date or any date < 01/01/2010, how can i validate that and show an alert saying that the date is invalid. Please any help on this would be appreciated.
Thanks
Harish
The DateField component has a "dataChange" event that you can listen to. So you can attach a handler to that event and do the validation as required.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/DateField.html#event:dataChange
You can do it in following way.
Maybe you could try a different aproach after seeing all this great examples
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d9b.html#WS2db454920e96a9e51e63e3d11c0bf69084-7db3
The
DateField
component has avalueCommit
event that you can listen to. So you can attach a handler to that event and do the validation as required.