Problems with Boostrap datepicker

0

I am using BOOTSTRAP , to have a calendar on my website. It works well, except that when loading the page, I see the calendar already displayed.

the definition HTML of the field is:

<label for="txtfechainicio" class="aligncenter">
     Fecha de Inicio
     <input type='text' id='txtfechainicio' class="datetimepicker" name="txtfechainicio" />
</label>

The definition of the field in JS

$(function() {
    $('#txtfechainicio').datepicker({maxDate: '+2Y',minDate:'-0Y', autoclose: true});
});

I have tried giving the focus to some other element of the form and even using the'hiden' option

$('#txtfechainicio').datepicker("hiden");

The idea is to hide it, until the user does not focus on the text field. Any ideas?

This is the page when loading with the console

As you can see, the textarea , is with the focus and the calendar displayed

    
asked by Jose Javier Segura 28.05.2018 в 23:45
source

0 answers