Flex DateField使用Editable = True验证日期 [英] Flex DateField validate date with Editable = True

查看:153
本文介绍了Flex DateField使用Editable = True验证日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Datefield组件,其Editable = true

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" />

日历具有我们想要的所有内容(只能选择2010年1月1日之后的有效日期) 。现在的问题是,如果用户输入(Editable = true),则无效日期或任何< 2010年1月1日,我如何验证该日期并显示警告说日期无效。

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.

谢谢

Harish

推荐答案

DateField 组件具有一个 valueCommit 事件,你可以听。因此,您可以将处理程序附加到该事件并根据需要进行验证。

The DateField component has a valueCommit event that you can listen to. So you can attach a handler to that event and do the validation as required.

这篇关于Flex DateField使用Editable = True验证日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆