I want to set max length to 5 for textbox, Can anyone please let me know how to do that.
@(Html.Kendo().TextBoxFor(m => m.LstPreEmploymentWorkflowModel.MiddleInitial))
I tried doing
@(Html.Kendo().TextBoxFor(m => m.LstPreEmploymentWorkflowModel.MiddleInitial).Name("middlenm")
$("#firstnm").attr('maxlength','5');
But if I use .Name, I get null value for middle name in the controller passed in through a model.
I beleive you need only do this:
@Html.Kendo().TextBoxFor(m => m.LstPreEmploymentWorkflowModel.MiddleInitial)
.HtmlAttributes(new { style = "width:50px", @maxlength = "5" }).Name("middlenm")