<form disabled> <input type="text" name="name" value="" /> <input type="submit" name="name" value="submit" /> </form>
EditForm
Quote:To disable elements you should use the disabled[^] attribute. I've modified your code a bit and this will do what you're after. Blazor will automatically add or remove the disabled attribute based on the IsDisabled value. You should use the disabled attribute on your button as well. It's a much better practice. HTML <button type="button" disabled="@IsDisabled"></button> <input bind="@IsDisabled" type="checkbox" /> <input disabled="@IsDisabled" type="time" /> @code{ protected bool IsDisabled { get; set; } }
<button type="button" disabled="@IsDisabled"></button> <input bind="@IsDisabled" type="checkbox" /> <input disabled="@IsDisabled" type="time" /> @code{ protected bool IsDisabled { get; set; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)