在af|inputDate 組件上防止鍵盤輸入 - 轉載
在af|inputDate 組件上防止鍵盤輸入
有些情況下,我們會需要日期輸入控件不允許用戶用鍵盤輸入日期。要實現這樣的功能就需要使用到Javascript。功能的效果如下圖:
Javascript:
1 2 | <af:resource> function disableEntry(evt){ evt.cancel(); } </af:resource> |
ADF:
1 2 3 | < af:inputDate label = "Label 1" id = "id1" readOnly = "false" contentStyle = "background-color:lightgray;" > < af:clientListener method = "disableEntry" type = "keyDown" /> </ af:inputDate > |
contentStyle設為灰色來提示該字段為只讀。
posted on 2011-09-16 11:55 蕭秋水 閱讀(467) 評論(0) 編輯 收藏 所屬分類: ADF