How do you prevent bootstrap-datepicker from clearing existing value from input if no date is selected?
问题 I have have a div with a user's date of birth pre-populated with php: <div id="datepicker" class="input-group date"> <label for="dob">Date of Birth</label> <input type="text" class="form-control" id="dob" name="dob" value="<?php $date = new DateTime($this->swimmers->dob); echo $date->format('d/m/Y');?>"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span> </div> The javascript: <script> $('.container .input-group.date').datepicker({ startDate: "01/01/1900", endDate: