mercredi 25 mars 2015

Laravel 5 form and bootstrap datepicker issue


I need some help with Laravel. I started using Laravel 5 with boostrap 3. I get it on this github: http://ift.tt/1qZE3v8


The thing is that i want to make a form to save on the database some information. One of the inputs is a date but just the year. I am trying to do it throught datepicker from bootstrap.


The code for form input is this:



<div class="col-md-12">
</br>
<div class="form-group">
<label class="col-md-2 control-label" for="name">Ciclo Escolar</label>
<div class="col-md-10">
<input class="form-control" tabindex="1" placeholder="Ciclo Escolar" type="text" name="ciclo" id="ciclo" value="{{{ Input::old('ciclo', isset($ciclo) ? $ciclo->ciclo : null) }}}">
</div>
</div>
</div>


The javascript code is:



@section('scripts')
<script type="text/javascript" src="/bootstrap-datepicker.js">
<script type="text/javascript" src="/bootstrap.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#ciclo').datepicker({
viewMode: 'years',
format: 'MM/YYYY'
});
} );
</script>
@stop


The result is just a input that show only the calendar but not like years.





Aucun commentaire:

Enregistrer un commentaire