2012-08-10 35 views
0
上添加

我想将datepicker放在我的应用程序上。你们能帮我吗?我对JQuery没有太多的知识。我需要添加额外的插件吗?或者只需要输入编码??这是我使用的编码。JQuery DataPicker在

<html xmlns="http://www.w3.org/1999/xhtml"> 
    <%@include file="header.jsp"%> 
    <head> 
    <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> 
    <script type="text/javascript"> 
    $('#example6').datetimepicker({ 
    showSecond: true, 
    timeFormat: 'hh:mm:ss', 
    stepHour: 2, 
    stepMinute: 10, 
    stepSecond: 10 
}); 
    </script> 
    </head> 
    <div id="templatemo_content_right"> 
    <h1>Login Form</h1> 
     <center> 
      <form action="LoginServlet" method="POST" id="theform" name="theform"> 
       <table cellspacing="20" cellpading="10"> 
        <tr> 
         <td>Department Id:</td> 
         <td><input type="text" name="departmentId" id="userName"/></td> 
        </tr> 
        <tr> 
         <td>Department Name:</td> 
         <td><input type="password" name="departmentName" id="password"/></td> 
        </tr> 
         <tr> 
         <td>Department Name:</td> 
         <td><input type="password" name="departmentName" id="password"/></td> 
        </tr> 
        <tr> 
         <td>Appointed Date:</td> 
         <td><input id="example6" type="text"></td> 
        </tr> 
        <tr> 
         <td><input type="submit" value="Login"/></td> 
        </tr> 


       </table> 



      </form> 
     </center> 

     <div class="cleaner_with_height">&nbsp;</div> 

    </div> <!-- end of content right --> 
    <%@include file="footer.jsp" %> 
</html> 

回答

0

您需要添加jQuery UI的脚本:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> 

添加它的jQuery脚本标记之后。

0

在jQuery的负载和脚本之间,你需要加载插件。或者我错过了什么。另外,为了将来的参考,如果您遇到困难,请创建一个jsfiddle