<input type="text" class="form-control" id="@acs.CTL_NAME" @ref="@(_inputRefs[acs.SRNO - 1])" inputmode="numeric" @bind="bindData[acs.SRNO-1]" tabindex="@acs.TAB_INDEX" @oninput="@((ChangeEventArgs e) => HandleNumber(e,acs.SRNO-1))"> @code{ public string[] bindData; //array is initialized with null in other method which is working fine private void HandleNumber(ChangeEventArgs e,int index) { string inputValue = e.Value?.ToString(); inputValue = inputValue?.Replace(".", ""); bindData[index] = Regex.Replace(inputValue, @"[^\d]", ""); StateHasChanged(); } }
type="number"
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; /* hide spinner buttons*/ } input[type=number] { -moz-appearance: textfield; /* Firefox - hide spinner buttons*/ }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)