Skip to main content

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.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[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.

<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