Using custom validity as below...
@(Html.Kendo()
.TextBoxFor(m => m.Task)
.Value(null)
.HtmlAttributes(new
{
required = "required",
oninvalid = "this.setCustomValidity('Enter a task')",
oninput = "this.setCustomValidity('')"
})
)
I've tried to do the same for other controls (numeric textbox, datetime picker, autocomplete) but it doesn't work.
For example, when trying the same thing for numeric textbox, in console I get an error "An invalid form control with name='Advance' is not focusable.
@(Html.Kendo().NumericTextBoxFor(m => m.Advance)
.Min(0).Max(1000)
.HtmlAttributes(new
{
id = "advance",
required = "required",
oninvalid = "this.setCustomValidity('Enter a number')",
oninput = "this.setCustomValidity('')",
})
)