balbarak / bootstrap-hijri-datepicker

Bootstrap Hijri Date picker
MIT License
56 stars 53 forks source link

hijridatepicker repeating fields #8

Open fawazmt opened 4 years ago

fawazmt commented 4 years ago

How can I repeat date picker many times in the same page? thank you

balbarak commented 4 years ago

You can use the below code

html

<div class="form-group">
    <label>
        Date
    </label>
    <div class="input-group">
        <input type='text' class="form-control" id="date1" />
    </div>
</div>
<div class="form-group">
    <label>
        Date
    </label>
    <div class="input-group">
        <input type='text' class="form-control" id="date2" />
    </div>
</div>
<div class="form-group">
    <label>
        Date
    </label>
    <div class="input-group">
        <input type='text' class="form-control" id="date3" />
    </div>
</div>

and in javascript use

 $(function () {

   $("#date1").hijriDatePicker();
   $("#date2").hijriDatePicker();
   $("#date3").hijriDatePicker();

});