Copy-Paste in RadNumericTextBox Seems to Work Incorrectly

6 posts, 0 answers
  1. ryanderso
    ryanderso avatar
    19 posts
    Member since:
    Mar 2007

    Posted 29 Aug 2008 Link to this post

    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?

  2. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 01 Sep 2008 Link to this post


    You have to remove the currency symbol "$12.53" - > "12.53"

    Hope this helps...
    <John:Peel />
  3. ryanderso
    ryanderso avatar
    19 posts
    Member since:
    Mar 2007

    Posted 10 Sep 2008 Link to this post

    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?

  4. Yavor
    Yavor avatar
    11 posts

    Posted 11 Sep 2008 Link to this post

    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,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Prashant
    Prashant avatar
    1 posts
    Member since:
    Jan 2013

    Posted 08 Apr 2013 Link to this post

    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,
  6. Vasil
    Vasil avatar
    1604 posts

    Posted 11 Apr 2013 Link to this post

    Hi Prashant,

    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")
    <telerik:RadNumericTextBox runat="server" ClientEvents-OnValueChanging="valueChanging">

    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.
Back to Top