bootstrap-datepicker在点击时没有响应

时间:2014-10-23 10:56:32

标签: bootstrap-datepicker

我已按照link

中的说明进行操作

我曾使用过jquery1.9.1.js,我已经将bootstrap-datepicker.js,datepicker.css添加到了我的页面。当我点击日历图标时没有响应,这是我的代码。

     <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
      <%@ taglib uri="/tags/struts-html" prefix="html" %>
      <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
       <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"           "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
       <title>Apply</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="styles/css/mystyle.css" type="text/css" />
       <link rel="stylesheet" href="styles/css/bootstrap.min.css">
       <link rel="stylesheet" href="styles/datapicker/css/datepicker.css" />
        </head>
        <body>
        <div class="container">
        <div class="row">       
        <div class="col-lg-12 col-md-12 col-xs-12 bg">  
           <table border="0">
        <tr>
        <td>Name</td><td colspan="5"><input type="text" value="<bean:write name="e"   property="name" />" /></td>
        </tr>
        <br />
        <tr>
       <td>Leave type</td><td colspan="5"><select>
         <option>---------select Leave type---------</option>
         <option>Personal</option>
        <option>Medical</option>
    <option>Tour</option>
    </select></td>  
    </tr>
    <tr>
    <td>Leave <br/> Balance</td><td colspan="5">
    <bean:define id="bal" name="leave" property="balance" />
    <html:text property="balance" value="<%=bal.toString() %>" />
    </tr>
    <tr>
    <td>From</td><td colspan="2"><div class="form-group row">
  <div class="col-xs-8">
    <label class="control-label">My Label</label>
       <div class="input-group date" data-datepicker="true" id="dp3" data-date="12-02-2012" data-date-format="mm-dd-yyyy">
         <input class="form-control" type="text" value="12-02-2012">
       <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
      </div>
    </div>
    </div>

    </td>
    <td colspan="3"><select>
    <option>-------select---------</option>
    <option>session1</option>
    <option>session2</option>
    </select>
    </td>
    </tr>

    <tr>
    <td>To</td><td colspan="2"><input type="text"></td>
    <td colspan="2"><select>
    <option>-------select---------</option>
    <option>session1</option>
    <option>session2</option>   
    </select>
    </td>
    <td><a href="holidays.jsp">Holidays</a></td>
    </tr>
    <tr>
    <td>Days</td><td colspan="5">0</td> 
    </tr>
    <tr>
    <td>Forward To/Approver</td><td colspan="5"><select>
    <option>PLEASE SELECT-001</option>
    <option>PLEASE SELECT-002</option>
    <option>PLEASE SELECT-003</option>
    <option>PLEASE SELECT-004</option>
    </select>
    </td>
    </tr>
    <tr>
    <td>Reason</td><td colspan="5"> <textarea cols="50"></textarea></td>
    </tr>
    <tr>
    <td>Contact Details</td><td colspan="5">    <textarea cols="50"></textarea></td>
    </tr>

     <tr>
    <td><button class="btn btn-primary">cc</button></td><td colspan="4">    <textarea cols="50"></textarea></td><td><button class="btn btn-primary">clear</button></td>
    </tr>
    <tr>
    <td colspan="6">(Separate multiple emails with commas)</td>
    </tr>
    <tr>
    <td colspan="6"><a href="review.jsp">show all levels reviewer</a></td>
    </tr>       
    <tr>
    <td colspan="6"><button class="btn btn-primary">apply</button>&nbsp;<button class="btn btn-primary">cancel</button></td>
    </tr>
    </table>
    </html:form>
    </div>
    </div>
  </div>

 </div>
 </div>
 </div>
     <script src="styles/datepicker/js/bootstrap-datepicker.js"></script>
     <script src="styles/js/bootstrap.js"></script>
     <script src="styles/js/jquery-1.9.1.js"></script>
     <script src="styles/js/dropdown.js"></script>
  </body>
  </html>

1 个答案:

答案 0 :(得分:1)

也许以正确的顺序放置链接会更好:

<script src="styles/js/jquery-1.9.1.js"></script>
<script src="styles/js/bootstrap.js"></script>
<script src="styles/datepicker/js/bootstrap-datepicker.js"></script>
<script src="styles/js/dropdown.js"></script>