Is there a way to change the position of validation message

≯℡__Kan透↙ 提交于 2019-12-06 05:29:49

You can use Adjacent sibling selector to properly position your validation message

.editor-field + span {
    // proper position
}

or even:

.editor-field + span.vld.vld-danger {
    // proper position
}
Jack

Finally I solved the problem as indicated on BoltClock's answer.

<span class="k-editor-val-message">
@Html.LabelFor(m => m.Description, new { maxlength = 1000, @class = "editor-label" })
@(Html.Kendo().EditorFor(m => m.Description)
    .Name("Description") 
    .HtmlAttributes(new { @class = "editor-field", style = "width:660px; height:140px;", 
         required = "required", data_required_msg="Required field"  })
)
@Html.ValidationMessage("Description")
</span>


<style> 
    .k-editor-val-message > .k-invalid-msg {
        // proper position
    }
</style>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!