Hi all -
I am having an issue with the RadNumericTextBox that hopefully someone knows the solution to. If I have the Input set to numeric and I copy-paste "$12.53" (or any other currency value), the result is that the value in the input ends up as "0.12" (or 0.[first two digits]). It seems like, instead, the input box should be ignoring all characters other than acceptable numeric values. This can be duplicated in the online example. Anyone have any idea how to resolve this?
Thanks,
Ryan
I am having an issue with the RadNumericTextBox that hopefully someone knows the solution to. If I have the Input set to numeric and I copy-paste "$12.53" (or any other currency value), the result is that the value in the input ends up as "0.12" (or 0.[first two digits]). It seems like, instead, the input box should be ignoring all characters other than acceptable numeric values. This can be duplicated in the online example. Anyone have any idea how to resolve this?
Thanks,
Ryan
5 Answers, 1 is accepted
0
plamen
Top achievements
Rank 1
answered on 01 Sep 2008, 09:07 AM
hi
You have to remove the currency symbol "$12.53" - > "12.53"
Hope this helps...
<John:Peel />
You have to remove the currency symbol "$12.53" - > "12.53"
Hope this helps...
<John:Peel />
0
ryanderso
Top achievements
Rank 1
answered on 10 Sep 2008, 06:54 PM
I realize that, but I have users that are used to being able to just copy-paste from a spreadsheet, and it seems like being able to ignore the "$" should be something that the control should do. The ideal situation would be that the control ignore every character that is non-numeric - so, if I were to paste in "abd$12.52" the result would be "12.52". Is there a modification that I can do to one of the javascripts that would permit this sort of functionality?
Ryan
Ryan
0
Hello ryanderso,
While bringing this functionality to the control by default is not planned, since this would potentially allow non-numeric input in a numeric control, you can attach to the onValueChanged client side handler, and restore the value to 12.53. I hope this is a suitable option for you.
Best wishes,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
While bringing this functionality to the control by default is not planned, since this would potentially allow non-numeric input in a numeric control, you can attach to the onValueChanged client side handler, and restore the value to 12.53. I hope this is a suitable option for you.
Best wishes,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Prashant
Top achievements
Rank 1
answered on 09 Apr 2013, 01:18 AM
Hi Telerik,
Is there a way to diable this functionality altogether, on the text box, when user paste a AlphaNueric string, I want to set the control value to '0' zero instead of only the filtered numeric value. i.e lets say if I paste ABS1245.4543 I want the paste operation to result in 0 'zero' being shown in text field instead of '1245.4543' which RadNumericTextbox would do by default.
Kind regards,
Prashant
Is there a way to diable this functionality altogether, on the text box, when user paste a AlphaNueric string, I want to set the control value to '0' zero instead of only the filtered numeric value. i.e lets say if I paste ABS1245.4543 I want the paste operation to result in 0 'zero' being shown in text field instead of '1245.4543' which RadNumericTextbox would do by default.
Kind regards,
Prashant
0
Hi Prashant,
You can parse the text manually on valueChanging event and set different value than internally parsed. Here is some example:
Greetings,
Vasil
the Telerik team
You can parse the text manually on valueChanging event and set different value than internally parsed. Here is some example:
<
script
type
=
"text/javascript"
>
function valueChanging(sender, args)
{
if (parseFloat(sender.get_element()).toString() == "NaN")
{
args.set_newValue(0);
}
}
</
script
>
<
telerik:RadNumericTextBox
runat
=
"server"
ClientEvents-OnValueChanging
=
"valueChanging"
>
</
telerik:RadNumericTextBox
>
Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.