ComponentsInputs and forms
Form and validation
MudForm validates MudBlazor inputs with functions and attributes; EditForm validates a model with data annotations. Use MudForm for quick forms without a model class, and EditForm when the model already carries its rules.
MudForm with validation functions
Each input validates itself; MudForm collects the results. Bind IsValid to enable the submit button and Errors to list every problem. Reset clears the values, ResetValidation only the messages.
IsValid: False
Errors (0)
Errors that arrive after submitting
Some problems are only known after asking a server. Show them on the field they concern, or above the form when they concern the whole submission.
@
Disabled, read-only and touched forms
Disabled and ReadOnly on MudForm reach every input inside it. IsTouched becomes true after the first change, which is useful for an unsaved-changes prompt.
No changes yet.