javascript - datetimepicker. widget doesn't show -


i trying repeat example datepicker documenation on jsfiddle

tutorial

i have wrote following html code:

<div class="container">     <div class="row">         <div class='col-sm-6'>             <div class="form-group">                 <div class='input-group date' id='datetimepicker1'>                     <input type='text' class="form-control" />                     <span class="input-group-addon">                         <span class="glyphicon glyphicon-calendar"></span>                     </span>                 </div>             </div>         </div>             </div> </div> 

and following js:

$(function () {                 $('#datetimepicker1').datetimepicker();             }); 

but when start see simple input:

demo

what did forget ?

p.s. wrote following html doesn't work

<html> <head>     <link href="//cdn.rawgit.com/eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/build/css/bootstrap-datetimepicker.css"           rel="stylesheet">     <script src='//code.jquery.com/jquery-2.1.4.js'></script>      <script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js'></script>      <script src='//cdn.rawgit.com/eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/src/js/bootstrap-datetimepicker.js'></script>       <script type="text/javascript">         //Настройка выборок для времени         $(document).ready(function () {             $('#startdatediv').datetimepicker({                 format: 'lt'             });          });     </script>  </head> <body>  <div class="row-fluid main-content chose" style="padding: 20px 0 67px 0;">     <form:form commandname="campaignbeandto" id="addparams" method="post">     <div class="param-line">             <div id="startdatediv" class="input-append date add-params-date-div">              <fmt:formatdate pattern='dd/mm/yyyy' type='date' value='${campaign.begindate}' var="begindate"/>             <form:input path="begindate" id="startdate" name="begindate"                         data-format="dd/mm/yyyy" type="text" />                             <span class="add-on">                                 <i data-time-icon="icon-time" data-date-icon="icon-calendar"> </i>                             </span>            </div>     </div>  </form:form>  </div> </body> </html> 

i don't see errors in console see simple input

you forgot include bootstrap.css , moment.js files,

https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.js 

here working fiddle.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -