Bootstrap Datepicker is not Working .Using BootStrap 3.3.1 -
first have downloaded zip file bellow link http://www.eyecon.ro/bootstrap-datepicker/ , got following structure 1.css folder - datepicker.css 2.js folder-bootstrap-datepicker.js 3.less folder - datepicker.less
then have added asp.net mvc 4 project structure , in index.cshtml have added references bellow code
<script src="http://code.jquery.com/jquery.js"></script> <script src="~/contents/bootstrap/js/bootstrap.min.js"></script> <script src="~/contents/bootstrap/js/npm.js"></script> <script src="~/contents/bootstrap/js/bootstrap-datepicker.js"></script> <script type="text/javascript"> $(function () { $('#datetimepicker9').datepicker(); $('#datetimepicker10').datepicker(); $("#datetimepicker9").onclick ("dp.change", function (e) { $('#datetimepicker10').data("datetimepicker").setdate(e.date); }); $("#datetimepicker10").onclick("dp.change", function (e) { $('#datetimepicker9').data("datetimepicker").setdate(e.date); }); }); </script> <div class="searchdatepickerrow"> <div class="searchfrmdate"> <form class="formmargin" role="form"> <div class="form-group"> <div class="input-group date" id="datetimepicker9"> <input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </form> </div> <div class="searchtodate"> <form class="formmargin" role="form"> <div class="form-group"> <div class="input-group date " id="datetimepicker10"> <input type="text" class="form-control" /> <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </form> </div> </div>
but when click on calander image datepicker not working. have followd bellow links how bootstrap-datepicker work bootstrap 3? bootstrap-datetimepicker not working not getting success.in above link mentioned add datetimepicker.js , moment.js file.
you have missed class datepicker or data attributes in input class. have add in input tag.
<input class="datepicker" data-provide="datepicker">
Comments
Post a Comment