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

NumericTextBox range problem

1 Answer 60 Views
Input
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 18 Nov 2011, 05:59 PM
I have a numeric text box that I set a minimum value of 1 and a maximum value of 99.  If I type 0 into the field the validation fires but it does not clear that 0 out of the text area.  On the OnError event I am trying to clear the value of the textbox but the 0 is still there.

<telerik:RadNumericTextBox Save="Text" ID="txtFileFormat" runat="server" 
                      MaxValue="99" MinValue="1"
                      Width="25px" TabIndex="1" AllowOutOfRangeAutoCorrect="False" 
                      AutoCompleteType="Disabled" ClientEvents-OnError="FileError">
                      <NumberFormat AllowRounding="False" DecimalDigits="0" />

function FileError(sender, args) {
  sender.set_textBoxValue(null);
}

Is there something that I am missing?  Does the OnError event prevent updates to that object?

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 19 Nov 2011, 12:24 PM
Hello,

function ValueChanging(sender, args) {
                if (args._newValue < sender._minValue) {
                    args._cancel = true;
                }
 
            }
<telerik:RadNumericTextBox Save="Text" ID="txtFileFormat" runat="server" MaxValue="99"
       MinValue="1" Width="100px" TabIndex="1" AllowOutOfRangeAutoCorrect="False" AutoCompleteType="Disabled"
        ClientEvents-OnError="FileError" >
        <ClientEvents OnValueChanging="ValueChanging" />
       <NumberFormat AllowRounding="False" DecimalDigits="0" />
   </telerik:RadNumericTextBox>


Thanks,
Jayesh Goyani
Tags
Input
Asked by
Robert
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or