# RadzenNumericRangeValidator not working with @oninput

**URL:** <https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036>\
**Category:** Blazor Server\
**Created:** [September 19, 2020, 9:22pm UTC](https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036 "2020-09-19T21:22:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [September 19, 2020, 9:22pm UTC](https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036/1 "2020-09-19T21:22:25Z")

</div>

Hi Radzen Team,

I am using RadzenNumericRangeValidator for validation on numeric and it is not working with @oninput, oninput is working fine.  
if I remove @oninput the validation is working, but I want to use both.  
Could you please suggest me on this.

\<RadzenNumeric Name="DecimalCount" @bind-Value="@decimalCount" TValue="decimal?" Step="0.1" @oninput="@(args=\> CheckCount(args.Value.ToString(), "DecimalCount"))" /\>\<RadzenNumericRangeValidator Component="DecimalCount" Max="12" Text="It must be between 0-12" Popup="true" Style="position: absolute; /\>

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [September 20, 2020, 8:15am UTC](https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036/2 "2020-09-20T08:15:26Z")

</div>

Hi @Shlok,

We can't reproduce this problem (see attached gif). I recommend commenting out the code in your CheckCount method to see what prevents it from working. ![oninput](https://forum.radzen.com/uploads/default/original/2X/e/ea1db1fa9a30002820ffcbbaa7631c6ab49ea3ba.gif)

---

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [September 21, 2020, 6:00am UTC](https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036/3 "2020-09-21T06:00:47Z")

</div>

Hi @korchev, below is the CheckCount method:

protected void CheckCount(string value, string control){

```
if (control == "DecimalCount")
{
	if (!string.IsNullOrWhiteSpace(value))
		decimalCount = Convert.ToDecimal(value);
	else
		decimalCount = null;
}

if (control == "DecimalCount1")
{
	if (!string.IsNullOrWhiteSpace(value))
		decimalCount1 = Convert.ToDecimal(value);
	else
		decimalCount1 = null;
}
	
if (!string.IsNullOrWhiteSpace(sName) && (decimalCount != null || decimalCount1 != null)
	isBtnDisabled = false;
else
	isBtnDisabled = true;

```

}

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [September 21, 2020, 6:36am UTC](https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036/4 "2020-09-21T06:36:35Z")

</div>

I don't know what this code is doing - you should investigate what could be causing the validation to fail. I guess it is updating the value without running validation again.

---

<div class="post-metadata">

**Author:** ![Shlok](https://forum.radzen.com/user_avatar/forum.radzen.com/shlok/32/7344_2.png) [@Shlok](https://forum.radzen.com/u/Shlok)\
**Post date:** [September 21, 2020, 6:55am UTC](https://forum.radzen.com/t/radzennumericrangevalidator-not-working-with-oninput/5036/5 "2020-09-21T06:55:39Z")

</div>

isBtnDisabled(bool) is the variable used to disable/enable the button based on the sName(string), decimalCount(decimal?) and decimalCount1(decimal?).  
If the sName is not empty and one of these two decimalCount or decimalCount1 is not null then only the button should enable. That's just it does.
