how to add datepicker in bootstrap(html form) code example

Example 1: How to add Datepicker in Bootstrap(HTML form)

<link href="~/Content/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />

Example 2: How to add Datepicker in Bootstrap(HTML form)

<div class='container' style='margin-top: 100px;'>
 <input type='text' class="form-control" id='datepicker' style='width: 300px;' > <br>
 <input type='text' class="form-control" data-provide="datepicker" style='width: 300px;' >
</div>

<!-- Script -->
<script type="text/javascript">
$(document).ready(function(){
 $('#datepicker').datepicker(); 
});
</script>

Example 3: How to add Datepicker in Bootstrap(HTML form)

<script src="~/Scripts/bootstrap-datepicker.min.js"></script>

Example 4: How to add Datepicker in Bootstrap(HTML form)

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script>

<!-- Datepicker -->
<link href='bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' rel='stylesheet' type='text/css'>
<script src='bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' type='text/javascript'></script>

Tags:

Misc Example