Blazor

How do I check the checkbox based on the text entered in the textbox?

How do I check the checkbox based on the text entered in the textbox?

To check the checkbox, use the textbox input event to get the entered text, and based on the text enable or disable it. In the following example, if the entered text is “check”, using the @bind attribute you can enable the checkbox.

<input @oninput="@((args) => { this.isCheck = ((string)args.Value == "check") ? true : false; })" />

<br />

<input type="checkbox" @bind="@this.isCheck" />

@code {

    private bool isCheck { get; set; }

}
Sumitra Kumari Shaw

An Engineering graduate who Enjoys building things that live on the internet.