datepicker中的问题? [英] problem in datepicker ?

查看:76
本文介绍了datepicker中的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using 
<script type="text/javascript">
    $(document).ready(function () {
        $('.dateTime').datepicker({ dateFormat: "dd/mm/yy" });
    });
</script>
 @Html.TextBox("DOB", Model.DOB.ToString("dd/mm/yy"), new { @class = "dateTime" })


当我这样做时,这将显示日期选择器

当我使用它将值绑定到模型时


when i do this this show the datepicker

when i use this to bind the value to model

@Html.EditorFor(m=>m.DOB, Model.DOB.ToString("dd/mm/yy"), new { @class = "dateTime" })



den datepicker禁用此datepicker jQuery ui会发生什么情况?



den datepicker is disable what going on with this datepicker jquery ui?

推荐答案

( document ).ready( 功能(){
(document).ready(function () {


(' " dd/mm/yy"}); }); </script> @ Html.TextBox(" ,Model.DOB.ToString( dd/mm/yy")," })
('.dateTime').datepicker({ dateFormat: "dd/mm/yy" }); }); </script> @Html.TextBox("DOB", Model.DOB.ToString("dd/mm/yy"), new { @class = "dateTime" })


当我这样做时,这将显示日期选择器

当我使用它将值绑定到模型时


when i do this this show the datepicker

when i use this to bind the value to model

@Html.EditorFor(m=>m.DOB, Model.DOB.ToString("dd/mm/yy"), new { @class = "dateTime" })



den datepicker禁用此datepicker jQuery UI会发生什么情况?



den datepicker is disable what going on with this datepicker jquery ui?


尝试:
@Html.EditorFor(m=>m.DOB, Model.DOB, new { @class = "dateTime" })



此外,请查看有关如何在MVC使用jQuery中添加日期选择器的博客文章:



Further, have a look at this blogpost on how to add a datepicker in MVC usng jQuery: ASP.NET MVC 3: Integrating with the jQuery UI date picker and adding a jQuery validate date range validator[^]


这篇关于datepicker中的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆