2013-12-18 37 views
0

<?php include('include_navigation.html');?>爲什麼不工作日期選擇器代碼

。所有的代碼是正確的,但工作時
我在我的網頁使用此代碼 那麼日期選擇器不能正常工作。爲什麼它發生plz告訴我哪裏的datepicker應該出現在哪裏?也
當我有刪除此代碼,日期選擇器代碼工作,我還沒有得到 這裏發生什麼,所以PLZ告訴我什麼是錯在這裏.....

日期選擇器代碼... ...

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/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.2/jquery-ui.js"></script> 

    <link rel="stylesheet" href="/resources/demos/style.css" /> 

    <style> 
    .datepicker{ 

    } 
    </style> 

    <script> 
    $(function() { 
    $(".datepicker").datepicker({ dateFormat: 'yy-mm-dd' }); 
    }); 
     </script> 



html code 

    <tr> 
    <td>Admission Date</td> 
    <td height="48">:</td> 
    <td height="48"><label><input type="text" name="AD_DT" id="AD_DT" 
      class="datepicker" style="width:80px;" /></label></td> 
     </tr> 

`

+0

你有你的控制檯上的錯誤? –

+0

您的HTML輸入標籤在哪裏? – Parixit

+0

這裏是沒有datepicker代碼的概率它是worrk,但是當我有使用 (<?php include('include_navigation.html');?>)此代碼在我的頁面datepicker不工作.... – pop

回答

-1

試試這個代碼

$(document).ready(function() { 
$(".datepicker").datepicker({ dateFormat: 'yy-mm-dd' }); 
}); 
+0

與他現有的代碼 – mplungjan

+0

相同這個函數在文檔被完全加載時執行。 $(document).ready( – Kamlesh

+0

)OP的'$(function(){'將工作得很好。問題是不同的 – mplungjan