How to disable an entire Blazor EditForm, along with all fields?

Viewed 620

I'm used to the handy form.disable() method in Angular's reactive forms, which disables all bound fields in the given form group (which can be the whole form). And obviously enabling them in a similar fashion is also possible.

Is there a similar method hidden somewhere in the EditForm in .NET5 Blazor?

I haven't managed to find anything similar yet. In fact I haven't even found a way to iterate through all fields that are bound to the model.

1 Answers

You could wrap your form inside a fieldset and bind the disable-property to a boolean-Property like so:

<form>
    <fieldset disabled="@IsDisabled">
        [... formfields ...]
    </fieldset>
</form>
Related