开发者

how to display the date format in rich:calendar?

In rich:calendar i want to display the date format, like by default before the user make any selecti开发者_如何学Goon i want to display the format 'mm/dd/yyyy' in the textbox


try this:

<rich:calendar...datePattern="mm/dd/yyyy"></rich:calendar>

EDITED:

if you want some default text to be in your input, you may try to use javascript(jQuery is here) as I used:

   jQuery('.search-criterion').val("mm/dd/yyyy");    

    jQuery('.search-criterion').blur(function(){
      jQuery(this).css('color','gray').css('font-style','italic');
        if((jQuery(this).val()!="")){
       jQuery(this).css('color','black').css('font-style','normal');
       }else{
      jQuery(this).attr("value","mm/dd/yyyy");
          }
        })jQuery('.search-criterion').focus(function(){
          jQuery(this).css('color','black').css('font-style','normal');
      if((jQuery(this).val()=="mm/dd/yyyy")){
       jQuery(this).attr("value","");
         }else {}
  })
 })
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜