Django [SOLVED]: Datepicker covers the input field within a modal

Django [SOLVED]: Datepicker covers the input field within a modal

Home Forums Frameworks Django Tutorials Django [SOLVED]: Datepicker covers the input field within a modal

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #246429

    Cloudy Point
    Keymaster

    QuestionQuestion

    The datepicker element is not created correctly within a modal, it covers the input field and I can not visualize the dataenter image description here

    html:

    <div id="datepicker" class="input-append date col-md-12" >
        <input  type="text" class="form-control">
        <span class="add-on">
            <span class="arrow"></span>
            <i class="fa fa-th"></i>
        </span>
    </div>
    

    js:

    <script src="{% static 'assets/plugins/bootstrapv3/js/bootstrap.min.js' %}" type="text/javascript"></script> 
    
    
    $("#datepicker").datepicker({
        format: "dd/mm/yyyy",
        startDate: "01-01-2015",
        endDate: "01-01-2020",
        todayBtn: "linked",
        autoclose: true,
        todayHighlight: true,
        container: '#myModal modal-body',
        zIndex: 2048,
    });
    

    #246430

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    This is for posterity, the datepicker had to be initialized in the input label.

    <input id="datepicker" type="text" class="form-control">
    

    on the other hand I had to implement this suggestion:

    Source: https://stackoverflow.com/questions/47944968/datepicker-covers-the-input-field-within-a-modal
    Author: Gianmar
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.