We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

OnTextChange event

Thread ID:

Created:

Updated:

Platform:

Replies:

147796 Sep 24,2019 01:41 PM UTC Sep 26,2019 09:07 AM UTC Blazor 4
loading
Tags: DateTime Picker
Mr Andrey Voronov
Asked On September 24, 2019 01:41 PM UTC

I set ShowClearButton="true" on both EjsDatePicker and EjsTimePicker. OnChange event is not fired if I click on X "clear" icon.

I need OnTextChanged event which will be fired when text is changed (by a user input, copy, cut, paste etc).

Gopi Govindasamy [Syncfusion]
Replied On September 25, 2019 08:56 AM UTC

Hi Andrey,  

Greetings from Syncfusion support.  
  
We would like to inform you that, we have provided ValueChange event, it will be fired when value has changed and also clicking "X" icon. Based on your requirement cut, copy, paste the text into input element, the ValueChange event will be triggered when the component focus out. The oninput event is fired immediately after the value of an element has changed. We have prepared sample based on your requirement for your reference. 

@using Syncfusion.EJ2.Blazor.Calendars; 
 
<EjsDatePicker ValueChange="DateChange" @oninput="OnTextChange"></EjsDatePicker> 
 
<p>@dateValue</p> 
 
<EjsTimePicker ValueChange="TimeChange" @oninput="OnTextChange"></EjsTimePicker> 
 
<p>@timeValue</p> 
 
@code{ 
 
    private DateTime? dateValue { get; set; } 
 
    private DateTime? timeValue { get; set; } 
 
 
    public void DateChange(ChangedEventArgs args) 
    { 
        dateValue = args.Value; 
    } 
 
    public void TimeChange(Syncfusion.EJ2.Blazor.Calendars.ChangeEventArgs args) 
    { 
        timeValue = args.Value; 
    } 
 
    public void OnTextChange(Microsoft.AspNetCore.Components.ChangeEventArgs args) 
    { 
        Console.WriteLine(args.Value); 
    } 
} 


Regards, 
Gopi G. 
 


Mr Andrey Voronov
Replied On September 25, 2019 11:06 AM UTC

When I press on X, ValueChange event is triggered only if valid value is entered in text box

Enter invalid date/time "ab" in EjsDatePicker, click on X, neither ValueChange no OnInput are triggered

Mr Andrey Voronov
Replied On September 25, 2019 11:38 AM UTC

Adding Text {get;set;} to EjsDatePicker and EjsTimePicker would make everything much easier

Gopi Govindasamy [Syncfusion]
Replied On September 26, 2019 09:07 AM UTC

Hi Andrey, 

Thanks for your update.  

We would like to inform you that the ValueChange event triggered only when the valid date is entered in the DatePicker component. Your requirement is to listen to changes in some event even if the value you entered is not in the Date type. Based on your requirement, we will consider providing the "Cleared" event when the user clears the value using the"x" icon. It will fire on both invalid and valid date text removal action by clicking on the "X" icon. The event will be made available and the fix will be included on the upcoming release scheduled for mid-October 2019. You can track the status of this issue using a link below the feedback portal. 


If the above solution does not meet your requirements, please let me know your exact requirement with your actual use case in order to provide you with an accurate solution. 

Regards, 
Gopi G. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon