【问题标题】:Value clear after focusout of the textbox with datepicker使用日期选择器聚焦文本框后清除值
【发布时间】:2019-12-16 08:28:16
【问题描述】:
$(document).ready(function () {
    $(".datepicker1").datepicker({ 
        dateFormat: "dd/M/yy", 
        changeMonth: true, 
        changeYear: true,  
        yearRange: '1960:1994', 
        defaultDate: '01/Jun/94' 
    });
});

<asp:TextBox runat="server" ID="txtDateOfBirth" class="textbox_shorts datepicker1" autocomplete="off" ></asp:TextBox>

上面提到的是我的代码。

当我在日期选择器上选择日期时,日期可以显示在文本框中,但是,在文本框聚焦后,该值将消失。怎么解决?

【问题讨论】:

    标签: jquery datepicker


    【解决方案1】:

    这应该为你工作

    $('.datepicker1').focusout(function(){ $(this).text('')})
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-17
      • 2015-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多