This is a migrated thread and some comments may be shown as answers.

RadNumericTextbox validation

3 Answers 137 Views
Input
This is a migrated thread and some comments may be shown as answers.
Trupti G
Top achievements
Rank 1
Trupti G asked on 20 Oct 2009, 11:21 AM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Oct 2009, 12:54 PM
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.
0
Trupti G
Top achievements
Rank 1
answered on 20 Oct 2009, 03:52 PM
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
0
Divya
Top achievements
Rank 1
answered on 27 Jul 2011, 03:07 PM
Did you get the Solution for the problem.
me to have the same problem
Tags
Input
Asked by
Trupti G
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Trupti G
Top achievements
Rank 1
Divya
Top achievements
Rank 1
Share this question
or