2011-09-27 77 views
0

我想寫一個使用CodeIgniter的註冊表單,並希望使用jobery datepicker DOB,但以下不起作用。這是整個頁面:jquery datepicker與codeigniter問題

<!DOCTYPE HTML> 
<html> 
<head> 

    <link rel="stylesheet" href="http://localhost/cc/css/style.css" type="text/css" media="screen" charset="utf-8"> 
    <link rel="stylesheet" href="http://localhost/cc/jquery/css/dot-luv/jquery-ui-1.8.16.custom.css" type="text/css" media="screen" charset="utf-8"> 
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script> 
    <script src="http://localhost/cc/jquery/js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script> 
    <title>CC - Card Central</title> 
</head> 

<body> 
    <script> 
     $(function() { 
      $(".datepicker").datepicker(); 
     }); 
    </script> 

    <fieldset> 
     <legend>Create a new account!</legend> 
      <fieldset> 
       <legend>Personal Information</legend> 
       <form action="http://localhost/cc/index.php/account/create_account" method="post" accept-charset="utf-8"> 
        <input type="text" name="firstname" value="" placeholder="First Name" /> 
        <input type="text" name="middlename" value="" placeholder="Middle Name" /> 
        <input type="text" name="lastname" value="" placeholder="Last Name" /> 
        <input type="text" name="dob" value="" placeholder="Date of Birth" class="datepicker" /> 
      </fieldset> 
      <fieldset> 
       <legend>Account Information</legend> 
        <input type="text" name="username" value="" placeholder="Username" /> 
        <input type="text" name="password" value="" placeholder="Password" /> 
        <input type="text" name="passwordconfirm" value="" placeholder="Password Confirm" /> 
        <input type="submit" name="submit" value="Done!" />   
      </fieldset> 
     </fieldset> 
    </body> 
</html> 
+0

什麼不起作用?有沒有錯誤,你的調試器說了什麼? (firebug/chrome/safari調試器) – Jakub

回答

5

你忘了包括jQuery庫:-)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> 

將是引用jQuery UI的,你應該是好的腳本標籤去

+0

工作正常。謝謝。 – XstreamINsanity