This code will help you to understand how to input components enabled/disabled in Blazor.
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; } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Use the “Disabled” attribute to disable the input component. In the following example, input and checkbox are disabled on button click.
need an explanation for this answer? contact us directly to get an explanation for this answer