Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap daterangepicker open by button

i use the bootstrap daterangepicker (dangrossman) and Bootstrap 3. Now i want does i can the daterangepicker open with a addon-button and with clickling in the input field

my code:

<div class="form-group">
        <div class="input-group input-group-sm">
            <span class="input-group-btn">
                <button class="btn btn-default" type="button"><span class="glyphicon glyphicon-calendar"></span></button>
            </span>
                <input id="daterangepicker" class="form-control" type="text" name="daterangepickerDisplay">
        </div>
    </div>

This works.. but only when i click in the inputfield..

like image 482
se88 Avatar asked Mar 04 '15 10:03

se88


1 Answers

This worked for me:

$('#my-input').data('daterangepicker').toggle();
like image 131
Dhivya Avatar answered Oct 21 '22 07:10

Dhivya