我在我的MVC项目中使用了weareoutman ClockPicker,当我的视图中只有一个clockPicker字段时,它就能很好地工作。例如,对于会议表,我需要一个开始和结束时间,第二个clockPicker不起作用(当我单击没有clockPicker时)。
下面是我如何在Create视图中使用它:
<div class="form-group">
@Html.LabelFor(model => model.StringStartTime, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.StringStartTime, new { htmlAttributes = new { @class = "form-control clockPicker", id = "single-input", value = "", placeholder = "اکنون" } })
@Html.ValidationMessageFor(model => model.StringStartTime, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.StringEndTime, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.StringEndTime, new { htmlAttributes = new { @class = "form-control clockPicker", id = "single-input", value = "", placeholder = "اکنون" } })
@Html.ValidationMessageFor(model => model.StringEndTime, "", new { @class = "text-danger" })
</div>
</div>因此,问题再次出现:第二个clockPicker不起作用(单击文本框后,时钟选择器不会弹出)。我做错了什么?
发布于 2015-11-21 07:15:49
我通过给EndTime一个不同的id来解决这个问题。
https://stackoverflow.com/questions/33798034
复制相似问题