Readonly attribute never false

1 Answer 1404 Views
DropDownList TextBox
serge
Top achievements
Rank 2
Bronze
Iron
Iron
serge asked on 17 May 2021, 10:18 PM

in the HtmlAttributes , of a TextBox, or DrowDownList etc it seems there is no way to put readonly to false, at least, there is any effect: the field remains always readonly, once the readonly attribute is present, even if is readonly = false;

@(Html.Kendo().TextBoxFor(m=>m.ToitTN).HtmlAttributes(new { @readonly = false })) 
that code will display a readonly textbox. no matter if the readonly is false... 

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 20 May 2021, 11:00 AM

Hello, Serge,

Thank you for sharing your observations. Indeed, you have observed the default behavior of the readonly attribute that comes from JavaScript, by default. More information on the exact logic that it applies could be found here:

https://www.w3schools.com/tags/att_input_readonly.asp

Note that the exact same behavior will be observed in a plain HTML input (outside of the scope of the Telerik UI products).

I have followed up with further information in another thread of yours:

https://www.telerik.com/forums/dropdownlist-readonly-property-keeps-control-readonly-when-readonly-false

Feel free to reach out to me if there is anything else I can help with.

 

Regards,
Tsvetomir
Progress Telerik

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/.

Tags
DropDownList TextBox
Asked by
serge
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Tsvetomir
Telerik team
Share this question
or