【问题标题】:how to display the date format in rich:calendar?如何在 Rich:calendar 中显示日期格式?
【发布时间】:2011-03-04 08:23:48
【问题描述】:

rich:calendar 中,我想显示日期格式,默认情况下,在用户进行任何选择之前,我想在文本框中显示格式'mm/dd/yyyy'

【问题讨论】:

  • 您的意思是默认输入文本吗?

标签: jsf richfaces


【解决方案1】:

试试这个:

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

已编辑:

如果你想在你的输入中加入一些默认文本,你可以尝试使用我使用的 javascript(jQuery is here):

   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 {}
  })
 })

【讨论】:

    猜你喜欢
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-07
    相关资源
    最近更新 更多