Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxMaskPropertiesBase.InvalidInputNotificationText Property

Specifies the validation message displayed when a data editor value does not match the applied mask.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public string InvalidInputNotificationText { get; set; }

#Property Value

Type Description
String

The notification message’s text.

#Remarks

Use the InvalidInputNotificationText property to specify the validation message for a masked data editor in the standard EditForm component.

Razor
<EditForm Model="@starship"
          OnValidSubmit="@HandleValidSubmit"
          OnInvalidSubmit="@HandleInvalidSubmit"
          Context="EditFormContext">
    <DataAnnotationsValidator />
    <DxFormLayout>
        <DxFormLayoutItem Caption="Identifier:" ColSpanMd="6">
            <DxMaskedInput @bind-Value="@starship.Value"
                           Mask=".{6,}"
                           MaskMode="MaskMode.RegEx">
                <DxRegExMaskProperties InvalidInputNotificationText="The value is invalid. It must be at least 6 symbols." />
            </DxMaskedInput>
        </DxFormLayoutItem>
        <DxFormLayoutItem ColSpanMd="12">
            <DxButton SubmitFormOnClick="true"
                      Text="Submit"
                      RenderStyle="ButtonRenderStyle.Secondary" />
        </DxFormLayoutItem>
        <DxFormLayoutItem ColSpanMd="12">
            <ValidationSummary />
        </DxFormLayoutItem>
    </DxFormLayout>
</EditForm>

@code {
    string FormValidationState = @"Press the ""Submit"" button to validate the form.";
    Starship starship = new Starship() { Value = "ID" };

    void HandleValidSubmit()
    {
        FormValidationState = @"Form data is valid";
    }
    void HandleInvalidSubmit()
    {
        FormValidationState = @"Form data is invalid";
    }

    public class Starship {
        public String Value { get; set; }
    }
}

Regular Expression Masks - Validation Message

For more information on input validation, refer to the following topic: Validate Input.

See Also