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

ChangedEventArgs and FocusOutEventArgs do not provide the ID of the textbox that triggered the event

Thread ID:

Created:

Updated:

Platform:

Replies:

151377 Feb 9,2020 07:50 PM UTC Feb 11,2020 06:10 AM UTC Blazor 3
loading
Tags: TextBox
Edward Kagan
Asked On February 9, 2020 07:50 PM UTC

Both ChangedEventArgs and FocusOutEventArgs have Container property, that in turn has ID property.  I expect this to be filled with the ID of the textbox that triggered the Blur or ValueChange event.  Unfortunately, even though the textbox has an ID property specified, it is not passed in the event arguments.

I have a common handler for all textboxes and need to know which textbox element triggered the event.

Sureshkumar P [Syncfusion]
Replied On February 10, 2020 10:29 AM UTC

Hi Edward, 
 
Greetings from Syncfusion support. 
 
We can pass the component ID in the change and focus out event as mentioned in the below code example. 
 
<EjsTextBox ValueChange="@(e => onTxtChange(e, "Field1"))" Blur="@(e => onBlur(e, "Field1"))" Placeholder="Enter First Name"></EjsTextBox> 
<EjsTextBox ValueChange="@(e => onTxtChange(e, "Field2"))" Blur="@(e => onBlur(e, "Field2"))" Placeholder="Enter Last Name"></EjsTextBox> 
<EjsTextBox ValueChange="@(e => onTxtChange(e, "Field3"))" Blur="@(e => onBlur(e, "Field3"))" Placeholder="Enter Email ID"></EjsTextBox> 
  
@code{ 
  
public void onTxtChange(Syncfusion.EJ2.Blazor.Inputs.ChangedEventArgs args, string ID) 
{ 
Console.WriteLine("component ID is:", ID); 
} 
public void onBlur(FocusOutEventArgs args, string ID) 
{ 
Console.WriteLine("component ID is:", ID); 
} 
} 
 
 
Please find the sample from the below link. 
 
 
Regards, 
Sureshkumar P 


Edward Kagan
Replied On February 10, 2020 04:00 PM UTC

That works, thank you!

Sureshkumar P [Syncfusion]
Replied On February 11, 2020 06:10 AM UTC

Hi Edward, 
 
 
Regards, 
Sureshkumar P 


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