2015-10-20 30 views
0

當我點擊輸入字段,然後出現一個日期選擇器。選擇日期後,它顯示在輸入欄中,但日期選取器窗體不會消失。怎麼做 。我的表單代碼是在bootstrap中選擇任何日期時如何消失日期選取器?

<div class="form-group"> 
<label class="control-label col-sm-2" for="date_of_report">Date Of Report:</label> 
    <div class="col-sm-10"> 
     <input id="date_of_report2" name="date_of_report" class="input-small datepicker2 " type="date" />             

    </div> 
</div> 

我的劇本是

$('.datepicker2').datepicker('update'); 

enter image description here

回答

1

使用日期選擇器的option並添加autoclose像這樣

$('#datepicker').datepicker({ 
    autoclose: true, 
}); 

看到documentation這裏

+0

謝謝..邁克羅斯..它工作正常。 –

相關問題