Bootstrap datepicker doesn't get the value
Hello! I am using bootstrap datepicker , but the problem is that the value is empty.
I have this function:
- public static function date_bootstrap($name, $id, $value = null) {
- $input = '<div class="col-lg-3">' ;
- $input .= '<div class="input-group input-append date" name = "'.$name.'" id="' . $id . '" data-date="12/12/2012" data-date-format="dd-mm-yyyy">' ;
- $input .= '<input class="form-control" type="text" value="' . $value . '" readonly="">' ;
- $input .= '<span class="input-group-addon add-on"><i class="fa fa-calendar"></i></span> ' ;
- $input .= '</div></div>';
- return $input;
- }
And in view
- {{Helpers\Helper::date_bootstrap('maintenance_date','dp3',Input::old('maintenance_date'))}}
js
- $(function() {
- $("#dp3").datepicker();
- });
The problem is that even after selecting the date, value is empty. What is wrong?