2016-11-28 62 views
0

我正在使用Higchart圖與引導日期選擇器。我有一個日期的texbox。當我點擊選擇日期的tectbox時,鍵盤打開並顯示我之前選擇的某些日期。我的腳本在這裏:引導移動設備鍵盤顯示

<script type="text/javascript"> 

     $(document).ready(function() { 

      $('#date').datepicker({ //# ile id üzerinden yaparsanız yanlızca bir input çalışır 
       format: "yyyy-mm-dd", //dd-mm-yyyy 
      autoclose: true, 
      weekStart: 1, 
      "disableTouchKeyboard": true 
      }).load('show', function() { 
     var today = new Date(); 
     var curr_date = today.getDate(); 
     var curr_month = today.getMonth()+1; 
     var curr_year = today.getFullYear(); 
     var currentDate = curr_year + "-" + curr_month + "-" + curr_date; 
     $(this).val(currentDate); 
     }); 
     }); 

</script> 

我在哪裏做錯了?

回答

0

不知道,但,這可能有助於

$('#date').datepicker({ //# ile id üzerinden yaparsanız yanlızca bir input çalışır 
       format: "yyyy-mm-dd", //dd-mm-yyyy 
      autoclose: true, 
      showOnFocus: false, 
      }) 
+0

它不起作用。 – catcher

+0

我添加我的輸入只讀,我的問題解決了 – catcher

+0

但這會讓您的輸入框灰色禁用 –

0

剛剛還在日期選擇只讀屬性添加。

$(".datepicker").datepicker({ 
    format: "dd-M-yyyy", 
    autoclose: true, 
    disableTouchKeyboard: true, 
    Readonly: true 
}).attr("readonly", "readonly");