开发者

jquery datepicker strange issue

开发者 https://www.devze.com 2023-01-16 21:45 出处:网络
Why would when using this code in one place set the default as it should but not when moving first two statements into Master file and the last one into View file (ASP.NET MVC app)?

Why would when using this code in one place set the default as it should but not when moving first two statements into Master file and the last one into View file (ASP.NET MVC app)?

$(function () {
$(".editDate").datepicker({ dateFormat开发者_Python百科: 'dd.mm.yy' });
$(".editDate").datepicker($.datepicker.regional['sl']);
$("#IssueDate").datepicker('setDate', new Date()); // if I separate this one into it own file, it never sets the default date
}); 

??


without seeing the rest of the code, I would guess that you are trying to call "setDate" before the js that actually turns your input into a datepicker gets called.

0

精彩评论

暂无评论...
验证码 换一张
取 消