开发者

Date Picker attached to InputText tag [duplicate]

This question already has an answer here: 开发者_C百科 date+time picker for jsf (1 answer) Closed 2 years ago.

In JSF, I would like to have a date helper attached to an h:inputText tag. The input text could either be a string or a date. I would just like something that would help the user input a correct date if thats what they are choosing.


Also you can try jQuery DatePicker, if you are using just JSF and don't want rich, prime or anything else.

Usage:

Page

<h:inputText id="InpDate" />

Javascript

$("#InpDate").datepicker({
   showOn: "button",
   buttonImage: "../images/calendarIcon.png",
   buttonImageOnly: true
}).mask("99/99/9999");

This will "attach" a calendar icon in your input, as you want. Maybe you will need to use "formId:InpDate" to get it working, but im not sure about this..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜