Jquery 如何在呈现视图页面后保留0值?
查看页面上的我的代码:Jquery 如何在呈现视图页面后保留0值?,jquery,.net,asp.net-mvc-4,razor,timepicker,Jquery,.net,Asp.net Mvc 4,Razor,Timepicker,查看页面上的我的代码: Html.LabelFor(x => x.StartTime, new {@class = ""}), Html.TextBoxFor(x => x.StartTime, new { @class = "startTime form-time", @Value = Model.StartTime.HasVa
Html.LabelFor(x => x.StartTime, new {@class = ""}), Html.TextBoxFor(x => x.StartTime, new
{
@class = "startTime form-time", @Value = Model.StartTime.HasValue
? new DateTime(Model.StartTime.Value.Ticks).ToString("h:mm tt")
: string.Empty
})
我在开始时间字段中使用Jquery在计时器中选择了上午8:00。但在从下拉字段中选择一个值(转到服务器端)后,在呈现视图页面后,时间选择器字段值更改为8:00 AM。也就是说,它删除0值。但我希望该值与08:00 AM类似,您需要在计时器配置中定义它,如
$('#timepicker').timepicker({
showPeriod: true,
showLeadingZero: true
});
您可以在Francois Gelinas页面的上找到更多信息。您需要在计时器配置中定义这一点,如
$('#timepicker').timepicker({
showPeriod: true,
showLeadingZero: true
});
你可以在Francois Gelinas的网页上找到更多信息,它没有“删除”0值-它从来没有出现过-这就像需要使用
hh:mm tt
而不是h:mm tt
一样简单吗?它没有“删除”0值——它从未存在过——简单到需要使用hh:mm tt
而不是h:mm tt
?我包含了showLeadingZero:true
值,但即使0
值已被删除。我包含了showLeadingZero:true
值,但即使0
值已被删除移除。工作正常。谢谢,工作正常。非常感谢。