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

How to restrict the postback after reaching maxvalue of Radnumeric textbox

2 Answers 83 Views
Input
This is a migrated thread and some comments may be shown as answers.
suresh
Top achievements
Rank 1
suresh asked on 16 Feb 2012, 06:39 AM
HI there,
How to restrict the postback when we click upper arrow in the numeric textbox after reaching the maxvalue?? or Is it possible to disable the upper arrow after reaching maxvalue.??..I am aware of textbox doesn't allow the value that exceeding maxvalue.
Here is my code ,
<telerik:RadNumericTextBox ID="tbDays" AutoPostBack="true"  MaxValue="50"
        runat="server" ontextchanged="tbDays_TextChanged">
        <NumberFormat DecimalDigits="0" />
    </telerik:RadNumericTextBox>
On server side:
protected void tbDays_TextChanged(object sender, EventArgs e)
    {
       int itemCount = int.Parse(tbDays.Text);
       ///Doing Some stuff..
    }
Thanks in advance..

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Feb 2012, 07:59 AM
Hello Suresh,

Try the following javascript.
JS:
function OnLoad(sender, args)
{
 if (sender.get_maxValue() == 50)
  {
   sender.set_autoPostBack(false);
  }
}

-Shinu.
0
suresh
Top achievements
Rank 1
answered on 16 Feb 2012, 08:42 AM
Thanks shinu..Its working perfectly..
Tags
Input
Asked by
suresh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
suresh
Top achievements
Rank 1
Share this question
or