2013-10-29 132 views
-2

我在我的codeigniter頁面中嘗試了一個簡單的日期選擇器,但不知何故它沒有顯示datepicker。日期選擇器不顯示

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> 
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script> 
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
    <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css" /> 
    <script type="text/javascript"> 
    $(function() { 
     $("#datepicker").datepicker(); 
    }); 
    </script> 

我的HTML代碼,

<input type="text" placeholder="Pickup Date" id="datepicker" name="datepicker" class="formfield_text hasDatepicker"> 
+0

歡迎來到[so]。你有沒有包含jQuery和jQuery UI?什麼是錯誤?目前,這個問題沒有提供足夠的細節來回答這個問題。例如,在控制檯中提供任何錯誤日誌併發布_full_ HTML。有關[so]問題的更多信息,請參見[問]。 –

+0

檢查datepicker的ID是「datepicker」? –

+0

chirag

回答

0

試試這個作爲你的HTML代碼,

<input type="text" placeholder="Pickup Date" id="datepicker" name="datepicker" class="formfield_text"> 

這工作。問題是你不能使用類hasDatepicker。刪除它並嘗試。