3 Answers, 1 is accepted
0
License
Top achievements
Rank 1
answered on 05 Mar 2014, 02:24 PM
Just little more info...
I am setting the limitations programmatically, so I can't really hard-code some values into a client-side function and check against that. I can't really tell what Client Events occur when the input is not within the range, but I would imagine that's the approach I would need to take here.
I am setting the limitations programmatically, so I can't really hard-code some values into a client-side function and check against that. I can't really tell what Client Events occur when the input is not within the range, but I would imagine that's the approach I would need to take here.
0
Princy
Top achievements
Rank 2
answered on 06 Mar 2014, 05:59 AM
Hi Robert,
One Suggestion is that you can programmatically find a range for RadNumericTextBox and assign those values in HiddenField, then compare those values with the RadNumericTextBox value in OnValueChanged event. Please have a look into the sample code snippet which works fine at my end.
ASPX:
JavaScript:
Let me know if you have any concern.
Thanks,
Princy.
One Suggestion is that you can programmatically find a range for RadNumericTextBox and assign those values in HiddenField, then compare those values with the RadNumericTextBox value in OnValueChanged event. Please have a look into the sample code snippet which works fine at my end.
ASPX:
<
telerik:RadNumericTextBox
ID
=
"RadNumericTextBox1"
runat
=
"server"
ClientEvents- OnValueChanged
=
"OnValueChanged"
>
</
telerik:RadNumericTextBox
>
<
asp:HiddenField
ID
=
"MinValue"
runat
=
"server"
/>
<
asp:HiddenField
ID
=
"MaxValue"
runat
=
"server"
/>
JavaScript:
<script type=
"text/javascript"
>
function
OnValueChanged(sender, args) {
//programatically set a maximum value and minimum value to the hidden fields
var
max = document.getElementById(
"MaxValue"
).value;
var
min = document.getElementById(
"MinValue"
).value;
if
(args.get_newValue() < min && args.get_newValue() > max)
sender.set_value(
""
);
}
</script>
Let me know if you have any concern.
Thanks,
Princy.
0
Hello Robert,
You can also set AllowOutOfRangeAutoCorrect="true" as alternative. In this case the input will be shown as invalid without auto-correcting the value.
Regards,
Vasil
Telerik
You can also set AllowOutOfRangeAutoCorrect="true" as alternative. In this case the input will be shown as invalid without auto-correcting the value.
Regards,
Vasil
Telerik
DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!