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

restrict user not to enter morethan 100

3 Answers 138 Views
Input
This is a migrated thread and some comments may be shown as answers.
sudheer
Top achievements
Rank 2
sudheer asked on 09 Jan 2009, 05:56 AM
Hi

i have a radnumeric textbox with type="Percentage". suppose if user enter morethan 100% i need to restrict .how can i achieve
looking for help

AdvancedThanks

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Jan 2009, 07:28 AM
Hi Sudheer,

One suggestion to achieve this functionality is by using RadMaskedTextBox. Please check the example below.

ASPX:
<telerik:RadMaskedTextBox ID="RadMaskedTextBox1" RoundNumericRanges="false" Runat="server" Mask="<0..100>"
</telerik:RadMaskedTextBox> 

Thanks,
Shinu.
0
sudheer
Top achievements
Rank 2
answered on 09 Jan 2009, 08:52 AM
Hi shinu,

Thanks for reply. i have one issue if i use radmasktextbox ,
there is no property Type="Percentage" which radnumerictextbox consists .by that while user entering he will get an idea he is entering percentage.

Is there any solution to approach it
0
Shinu
Top achievements
Rank 2
answered on 09 Jan 2009, 12:01 PM
Hello Sudheer,

Try modifying the code for RadMaskedTextBox as shown below:

ASPX:
<telerik:RadMaskedTextBox ID="RadMaskedTextBox1" RoundNumericRanges="false" Runat="server" Mask="<0..100> %"> 
</telerik:RadMaskedTextBox> 

Another option is that you can try the RadNumericTextBox with an alert which notifies the user if the entered value is more than 100. Please try the code snippet below.

ASPX:
<telerik:RadNumericTextBox ID="RadNumericTextBox1"  runat="server" MinValue="0" Type="Percent" > 
<ClientEvents  OnBlur="Blur" /> 
</telerik:RadNumericTextBox> 

JavaScript:
function Blur(sender, eventArgs) 
 if(sender.get_value()>100) 
    alert('enter a value less than 100'); 

Thanks,
Shinu.
Tags
Input
Asked by
sudheer
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
sudheer
Top achievements
Rank 2
Share this question
or