1

I am using jquery-timepicker, and it is not displaying the dropdown when I click on the input box. In my view:

<script type="text/javascript">
$(function(){
    $('#StartTime').timepicker(); 
});
</script>
/* ... */
<div class="col-xs-6 form-group">
    <label>Start Time:</label>
        <div class="input-group">
            <input type="text" class="form-control"  id="StartTime" />
            <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
        </div>
</div>

I know it is loading properly, because the ui-timepicker element is being added to the DOM when I click on the input box and it formats time entered in the box when it loses focus. It just isn't displaying the dropdown.

Musical Shore
  • 1,361
  • 3
  • 20
  • 41

2 Answers2

3

Check that you have all the dependencies. I copied your code to a snippet and added the dependencies from the official site and it worked well. I included the following dependencies: jQuery, jQuery timepicker and Bootstrap timepicker. The last two have CSS and JS files too.

$(function() {
  $('#StartTime').timepicker();
});
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.js"></script>
<link rel="stylesheet" type="text/css" href="https://jonthornton.github.io/jquery-timepicker/jquery.timepicker.css">
<script type="text/javascript" src="https://jonthornton.github.io/jquery-timepicker/lib/bootstrap-datepicker.js"></script>
<link rel="stylesheet" type="text/css" href="https://jonthornton.github.io/jquery-timepicker/lib/bootstrap-datepicker.css">

<div class="col-xs-6 form-group">
  <label>Start Time:</label>
  <div class="input-group">
    <input type="text" class="form-control" id="StartTime" />
    <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
  </div>
</div>
totymedli
  • 29,531
  • 22
  • 131
  • 165
2

Make sure there is no css definitions, which may hide this element.