我的观点如下
@using (Html.BeginForm("Apply", "Leave", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
Leave Type
@Html.DropDownListFor(m => m.LeaveTypeId, Model.LeaveType, "Choose...", new { @class = "form-control", @tabindex = "1" })
@Html.ValidationMessageFor(m => m.LeaveTypeId, "", new { @class = "label-danger" })
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
From Date
@Html.TextBoxFor(m => m.FromDate, new { @class = "form-control", @tabindex = "2" })
@Html.ValidationMessageFor(m => m.FromDate, "", new { @class = "label-danger" })
</div>
</div>
}
当我点击“应用”按钮时,它会自动聚焦下一个控件,因为我的标签索引已设置。那么有没有办法聚焦但不显示日期时间控件