<div class="form-group">
@Html.LabelFor(model => model.Title, htmlAttributes: new {@class = "control-label text-left "})
<div class="">
@Html.EditorFor(model => model.Title, new {htmlAttributes = new {id = "title", @class = "form-control checkIfFilled", placeholder = "F.eks. Front-end udvikler", required = "required"}})
@Html.ValidationMessageFor(model => model.Title, "", new {@class = "text-danger"})
</div>
</div>
为什么它到目前为止?它看起来像是在#34; By&#34;字段。
这是checkIfFilled()函数
function checkIfFilled() {
var allGood = [];
$('.checkIfFilled').each(function (i, obj) {
if ($(obj).val() == null || $(obj).val() == "") {
allGood.push(false);
}
else {
allGood.push(true);
}
});
if(allGood.includes(false)){
$('.checkFilled').prop("disabled", true);
}
else if ($('.panel-body').html() != null && $('.panel-body').html() != "<p><br></p>")
{
$('.checkFilled').prop("disabled", false);
}
}
但是,删除它仍然不会影响消息。