Please forgive me if this has already been addressed, but I believe I have found an issue with the RadNumericTextbox when specific ranges are involved.
The following is a simple mockup of the issue:
Values greater than 42 should not be allowed, however, when entering '400' the form submits and a value of '40' is sent to the custom validator's javascript function.
My assumption is that while typing 400, you obviously type 40 first and this value is then stored in the hidden field state somewhere. However, this value is not cleared upon adding more zeros to '40'
If I clear the textbox, the hidden field state correctly passes an empty string to the validation function.
Please let me know if there is something simple that I am missing.
Regards,
Chris
The following is a simple mockup of the issue:
<
html
>
<
head
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function RequireField(source, args) {
if (args.Value == '') {
args.IsValid = false;
}
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"ScriptManager"
runat
=
"server"
></
telerik:RadScriptManager
>
<
b
>Temp(°C):</
b
><
telerik:RadNumericTextBox
ID
=
"Temp"
Width
=
"100px"
NumberFormat-DecimalDigits
=
"1"
AllowOutOfRangeAutoCorrect
=
"false"
runat
=
"server"
MaxLength
=
"5"
MinValue
=
"30"
MaxValue
=
"42"
>
</
telerik:RadNumericTextBox
>
<
asp:CustomValidator
ID
=
"CustomValidator1"
runat
=
"server"
ClientValidationFunction
=
"RequireField"
ControlToValidate
=
"Temp"
ValidateEmptyText
=
"true"
ErrorMessage
=
"Temperature is required and must be between 30 and 42"
Display
=
"None"
ValidationGroup
=
"SendValidationGroup"
></
asp:CustomValidator
>
<
br
/><
br
/>
<
asp:Button
ID
=
"FormPost"
runat
=
"server"
Text
=
"Post Back"
ValidationGroup
=
"SendValidationGroup"
/>
<
asp:ValidationSummary
EnableClientScript
=
"true"
ShowMessageBox
=
"true"
ShowSummary
=
"false"
ID
=
"validationSummary"
ValidationGroup
=
"SendValidationGroup"
runat
=
"server"
/>
</
form
>
</
body
>
</
html
>
Values greater than 42 should not be allowed, however, when entering '400' the form submits and a value of '40' is sent to the custom validator's javascript function.
My assumption is that while typing 400, you obviously type 40 first and this value is then stored in the hidden field state somewhere. However, this value is not cleared upon adding more zeros to '40'
If I clear the textbox, the hidden field state correctly passes an empty string to the validation function.
Please let me know if there is something simple that I am missing.
Regards,
Chris