How did you add the required option to a TextBox?
i am trying to do this but it doesn't work
@ (Html.Kendo (). TextBox ()
.Name ("txtCodSRI")
.Placeholder ("001")
.Readonly (true)
.Value (@ country.CodSRI)
.HtmlAttributes (new {@required = "true"})
.HtmlAttributes (new {@class = "form-control"})
)
1 Answer, 1 is accepted
0
Accepted
Anton Mironov
Telerik team
answered on 02 Oct 2020, 12:46 PM
Hello Danny,
Thank you for the provided code snippet.
In order to set the "required" attribute of the Kendo UI TextBox, try the following:
Merge all the needed attributes in a single HtmlAttributes option.
Use the required property and "Readonly()" method separately as they are mutually exclusive.
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.