问题
For proper validation i have to rewrite into Laravel4 all the form fields i have, the main reason is that i need to add Input::old to all the fields.
So far it went good with text, textarea and checkbox. But i don't know how to deal with the calendar data. It is Datepicker, a pretty nice JQuery plugin: https://github.com/eternicode/bootstrap-datepicker There are two fields, one for the arrival, the other for the outgoing.
This is the html properly working:
<div class="input-append date ">
<p>
<label><span><i class="icon-calendar"></i></span> Arrival Date</label>
<input type="text" name="arrival" class="datepicker" data-date-format="dd/mm/yyyy" id="checkin" placeholder="click here"/>
</p>
</div>
<div class="input-append date">
<p>
<label><span><i class="icon-calendar"></i></span> Outgoing Date</label>
<input type="text" name="outgoing" class="datepicker" data-date-format="dd/mm/yyyy" id="checkout" placeholder="click here"/>
</p>
</div>
How can i write this in Laravel4? If for some reason is not possible is not a big deal, but is very important that i can add the Input::old('arrival') and Input::old('outgoing'). Someone knows how can i do it?
Thank you very much!
回答1:
If you have the input as:
value="{{ Input::old('inputName') }}"
it should work as we've discovered!
来源:https://stackoverflow.com/questions/19904059/laravel4-how-to-pass-datepicker-into-a-form