我有兩個字段類似HolidayDate使得下面,如何使汽車擇日而採摘日期
[Required]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
[DisplayName(Constants.DisplayName.HolidayDate)]
public virtual DateTime HolidayDate { get; set; }
[StringLength(50)]
[DisplayName(Constants.DisplayName.HolidayDay)]
public virtual string HolidayDay { get; set; }
在我CSHTML文件
<div class="col-md-3">
<label for="" class="control-label">Date</label>
<br />
@Html.EditorFor(model => model.HolidayDate, new { @class = "form-control"})
.DisableIf(() => Model.IsReadOnly == true)
</div>
<div class="col-md-3">
<label for="" class="control-label">Day</label>
<br />
@Html.TextBoxFor(model => model.HolidayDay, new { @class = "form-control"})
.DisableIf(() => Model.IsReadOnly == true)
</div>
如果我選擇一個日期HolidayDate字段,那麼該日期的那一天應該自動在HolidayDay字段中指定,所以請任何人都可以幫助找到解決方案
顯示jQuery代碼 – 2014-11-04 04:57:45
$(文件)。就緒(函數(){ $(「# HolidayDate「)。datepicker( { altField:」#HolidayDay「, altFormat:」DD「 }); }); – 2014-11-04 05:25:55
請參閱編輯的代碼.....如果你能幫助,那麼請幫我 – 2014-11-04 05:32:16