Use the “Disabled” attribute to disable the input component. In the following example, input and checkbox are disabled on button click.
<button @onclick="@onDisable">Disable</button>
<input type="text" disabled="@isDisable" />
<input type="checkbox" disabled="@isDisable" />
<button disabled="@isDisable">button</button>
@code {
private bool isDisable { get; set; }
private void onDisable()
{
this.isDisable = true;
}
}
Share with