2012-05-02 107 views

回答

21
<script> 
     $(function() { 
      $("#datepicker").datepicker({ 
       showOn: "button", 
       buttonImage: "http://jqueryui.com/resources/demos/datepicker/images/calendar.gif", 
       buttonImageOnly: true 
      }); 
     }); 
</script> 
3

如果您點擊鏈接到下面的例子中觀看源按鈕,你會看到這樣的事情是隻讀的。它應該是隻讀的,而不是用戶必須從datepicker中選擇的。

HTML:

$("#datepickerID").datepicker({   
    showOn: "button", 
    buttonImage: "images/calendar.png", 
    buttonImageOnly: true, 
    buttonText: "Select date", 
    minDate : 0, 
    showButtonPanel: true, 
    closeText: 'Clear', 
    onClose: function() { 
     var event = arguments.callee.caller.caller.arguments[0]; 
     // If "Clear" gets clicked, then really clear it 
     if ($(event.delegateTarget).hasClass('ui-datepicker-close')) { 
      $(this).val(''); 
     } 
    } 
}); 
+0

我沒有在我的下載calendar_icon.png。所以我想使用ui-icon-calendar圖像。 – user525146

0

我們可以從雖然場場清除指定日期:

相關問題