How to fire ValidateOninput for blazor component Text box

This I My common Razor Component


[CommomTextBoxComponent.razor]
<SfTextBox Placeholder="@Placeholder" @bind-Value="@BindingValue" Type="@InputType" ValidateOnInput="true" Autocomplete="AutoComplete.Off" FloatLabelType="FloatLabelType.Always" CssClass="@CssClass" ShowClearButton="true" maxlength="@MaxLength" minlength="@MinLength" />


@code{
        private string _value;


        [Parameter]
        public string BindingValue
        {
            get => _value;
            set
            {
                if (_value == value) return;
                _value = value;
                BindingValueChanged.InvokeAsync(value);
            }
        }


        [Parameter]
        public EventCallback<string> BindingValueChanged { get; set; }


        [Parameter]
        public InputType InputType { get; set; }


        [Parameter]
        public static string CssClass { get; set; }


        [Parameter]
        public static bool Validate { get; set; }


        [Parameter]
        public string Placeholder { get; set; }


        [Parameter]
        public int MaxLength { get; set; }


        [Parameter]
        public int MinLength { get; set; }
}

This is my razor page code


@page "/"



<CommonInputTextBox Placeholder="Login ID" @bind-BindingValue="m1.Login_User" MinLength="5" MaxLength="12" />



By defaut Syncfusion component supports Oninputvalidate after making it as a common it stopped working I cant able to validate onInput

Pl see the compononent code i have made it true still its not working


So please Help me to validate text box on input


Thanks In Advance


2 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team March 23, 2022 06:33 PM UTC

Hi Suryateja, 

You can validate the custom textbox component by enabling the ValidateOnInput property. We have also prepared a sample as per your requirement, 



 


Regards, 
Ponmani M 


Marked as answer

RP Ramesh Palagara April 3, 2024 10:10 AM UTC

Thanks it works for me


Loader.
Up arrow icon