Datepicker不以< input>值 [英] Datepicker does not start with the <input> value
本文介绍了Datepicker不以< input>值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个标记
<input tabindex="5" type="text" class="bgFecha date-pick" id="date2" value="12/03/2011" name="date2"/>
请注意输入的价值
但是onclick datepikcer从2年后开始:
but onclick the datepikcer starts with a 2 years later date:
这是调用:
$(function(){
$('.date-pick').attr('readonly','true');
$('.date-pick').datePicker({clickInput:true})
});
有什么问题?我需要使用datepicker来启用value =日期。
What is wrong? i need the datepicker to use the value="" date to start.
谢谢
推荐答案
jquery datepicker的默认格式为 mm / dd / yy
。您需要使用12/03/11。
The default format for jquery datepicker it's mm/dd/yy
. You need to use 12/03/11.
或者您可以更改日期格式:
$(function(){
$('.date-pick').attr('readonly','true');
$('.date-pick').datePicker({
clickInput:true,
altFormat: 'mm/dd/yyyy' // change the date format
});
});
这篇关于Datepicker不以< input>值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文