Hi everybody,
I have two RadNumericTextBox which represent initial and final values. I added two js functions, one goes for ini and the other goes for fin. These check values entered by user to verify that initial value is minor or equal to final value and viceversa.
The issue with my code is that ini value isnot being set when I call ini.set_value(fin.get_value()). It will only work if I enter (for the second time) a new bigger initial value (initial value cannot be bigger than final value).
I already debugged the js and it works fine but it has to be executed twice in order to see the corrected value at initial RadNumericTextBox.
Here is the RadNumericTextBox declaration
1.
<
telerik:RadNumericTextBox
ID
=
"TextInicio"
runat
=
"server"
Value
=
"0"
DataType
=
"System.Int32"
MinValue
=
"1"
>
2.
<
NegativeStyle
Resize
=
"None"
></
NegativeStyle
>
3.
<
NumberFormat
ZeroPattern
=
"n"
DecimalDigits
=
"0"
></
NumberFormat
>
4.
<
ClientEvents
OnValueChanging
=
"VerificarValorInicio"
/>
5.
</
telerik:RadNumericTextBox
>
And the javascript function
01.
function
VerificarValorInicio(sender,args)
02.
{
03.
var
txtIni = $find(
"<%=TextInicio.ClientID%>"
);
04.
var
ini = txtIni.get_value();
05.
var
txtFin = $find(
"<%=TextFin.ClientID%>"
);
06.
var
fin = txtFin.get_value();
07.
08.
// If user entered an ini value bigger than fin value (which is not allowed)
09.
if
(ini > fin) {
10.
txtIni.set_value(fin);
// txtIni won´t show the value passed by fin variable
11.
}
12.
}
Any ideas about this??
Thanks in advance