Laravel4:如何将Datepicker传递给表单? [英] Laravel4: How to pass Datepicker into a form?
问题描述
为了正确验证,我必须重写Laravel4所有的表单字段,
主要原因是我需要添加Input :: old到所有字段。
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.
到目前为止,文字,文本和复选框都很好。
但是我不知道如何处理日历数据。
它是一个非常漂亮的JQuery插件的Datepicker: https://github.com/eternicode/bootstrap -datepicker
有两个字段,一个用于到达,另一个用于传出。
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.
这是html正常工作:
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>
我如何在Laravel4中写这个?
如果由于某种原因不可能不是很大的事情,但非常重要的是我可以添加Input :: old('arrival')和Input :: old('outgoing')。
有人知道我该怎么办?
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?
非常感谢!
推荐答案
如果您的输入为:
value="{{ Input::old('inputName') }}"
它应该像我们发现的那样工作!
it should work as we've discovered!
这篇关于Laravel4:如何将Datepicker传递给表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!