RadNumericTextbox validation

4 posts, 0 answers
  1. Trupti G
    Trupti G avatar
    6 posts
    Member since:
    Aug 2009

    Posted 20 Oct 2009 Link to this post

    I need to validate radNumericTextbox, which in Currency type in my application.
    I need to validate it for max length 15, with 12 digit + . + 2 decimals.

    I don't want to display $ inside the textbox, i want that outside of the textbox.

    Please, suggest me the solution ASAP
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Oct 2009 Link to this post

    Hi Trupti G,

    I have tried following approach in order to achieve the scenario by adding OnKeyPress event and checking the length of typed number thereby cancel if 12 digits entered.

    ASPX:
     
    $<telerik:RadNumericTextBox ID="RadNumericTextBox2" Runat="server"  
        EnableTheming="False" MaxLength="15"
        <ClientEvents OnKeyPress="OnKeyPress" /> 
    </telerik:RadNumericTextBox> 
    [Note: I have not set the Type as Currency and put a ' $ ' symbol outside the textbox]

    JavaScript:
     
    <script type="text/javascript"
        function OnKeyPress(sender, eventArgs) { 
            if (sender.get_textBoxValue().length == 12 && (eventArgs.get_keyCode() != 46)) { 
                eventArgs.set_cancel(true);               
            } 
        } 
    </script> 

    -Shinu.
  3. Trupti G
    Trupti G avatar
    6 posts
    Member since:
    Aug 2009

    Posted 20 Oct 2009 Link to this post

    Hi,

    I have to use type as currency as have to show grouping of digits for currency.
    How can I show digit grouping without using type as currency?

    Trupti
  4. Divya
    Divya avatar
    7 posts
    Member since:
    Aug 2010

    Posted 27 Jul 2011 Link to this post

    Did you get the Solution for the problem.
    me to have the same problem
Back to Top