How do I *completely* remove a jQuery UI datepicker?

后端 未结 4 876
北恋
北恋 2020-12-28 11:29

I\'ve got a date text field I wish to only sometimes attach a DatePicker to, because I have some of my own text-handling scripts which handle partial date strings.

4条回答
  •  甜味超标
    2020-12-28 12:12

    depending on your situation, you could do it server side

    Ex. in asp-like sytax

    <% if( showDatePicker ) {%>
        $('#dp-div').DatePicker(); // or whatever
    <% } %>
    

    Edit
    How about setting the dateFormat of the datepicker? ie

    $( ".selector" ).datepicker({ dateFormat: 'yy-mm-dd' });
    

    you might be wanting

    $( ".selector" ).datepicker({ dateFormat: '...' });
    

提交回复
热议问题