Is it possible to get the value of a Numeric Textbox with "OnKeyUp"

Greetings!

In my specific case, I don't want do get the value of the key pressed, I want to get the value of the field.
My idea is to get the value of the field when the user press "Tab".

How could I do it?

1 Reply 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team May 10, 2021 11:03 AM UTC

Hi Consensu, 


Greetings from Syncfusion support. 


We checked your query. Yes, we can get the value of the numeric textbox component when pressing the tab in the KeyUp event. Kindly refer the following code. 


@using Syncfusion.Blazor.Inputs; 
 
<SfNumericTextBox TValue="int?" @bind-Value="@numericVal" @onkeyup="onKeyUp"></SfNumericTextBox> 
 
@code{ 
    public int? numericVal { get; set; } = 10; 
 
    public void onKeyUp(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args) 
    { 
       if(args.Key == "Tab") 
       { 
            var value = numericVal; 
       } 
    } 
} 


Kindly get back to us for further assistance. 


Regards, 
Sevvandhi N 


Marked as answer
Loader.
Up arrow icon