This is a migrated thread and some comments may be shown as answers.

Activate or deactivate a Telerik Button

1 Answer 1234 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Javier
Top achievements
Rank 2
Veteran
Javier asked on 16 Mar 2021, 02:37 PM
I need to activate or deactivate a Telerik Button depending on the content of a Telerik textbox.

1 Answer, 1 is accepted

Sort by
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>

<TelerikButton Enabled="@( 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/.

Tags
TextBox
Asked by
Javier
Top achievements
Rank 2
Veteran
Answers by
Svetoslav Dimitrov
Telerik team
Share this question
or