BOOTSTRAP 3 DATE PICKER NOT WORK WHY?

Alex Leblois

Total Post:67

Points:471
Posted by  Alex Leblois
 1836  View(s)
Ratings:
Rate this:
I'm using bootstrap 3 i want to make date picker of bootstrap this is my code
<div class="container">
    <div class="col-md-2">
        <label>Date Of Birth</label>
    </div>
    <div class="col-md-4">
        <div class="form-group">
            <input type='text' class="form-control" id='datetimepicker4' />
            <span class="add-on">
                <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
            </span>
        </div>
    </div>
</div>

script code here:

<script type="text/javascript">
    $(function () {
        $('#datetimepicker4').datetimepicker({
            pickTime: false
        });
    });
</script>

but this code is not work properly

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: Bootstrap 3 Date picker Not work why?

    try this code

    <div class="container">
        <div class="row">
            <div class="col-md-2">
                <label>Date of Birth</label>
            </div>
            <div class='col-sm-3'>
                <div style="width: 100%;" class="input-group date form_date col-md-12" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                    <input type="text" class="form-control" readonly="true" />
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
                <input type="hidden" id="dtp_input2" value="" />
            </div>
        </div>
    </div>

    script code:

    <script>
        $(function () {
            $('.form_date').datetimepicker();
        });
    </script>

      Modified On Apr-05-2018 06:34:14 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!