I need to activate or deactivate a Telerik Button depending on the content of a Telerik textbox.
1 Answer, 1 is accepted
0
Svetoslav Dimitrov
Telerik team
answered on 16 Mar 2021, 04:03 PM
Hello Javier,
You can use the Enabled parameter of the TelerikButton and set it to false based on the value of the TextBox. Below, I have added a basic example of this. You can use it as a base and extend it in your application.
Code snippet:
<TelerikTextBox @bind-Value="@TextBoxValue"></TelerikTextBox><TelerikButtonEnabled="@( TextBoxValue == "Test" ? false:true )">Type Test to disable the button</TelerikButton>
@code {
private string TextBoxValue { get; set; }
}
I hope this helps you move forward with your application.
Regards,
Svetoslav Dimitrov
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/.