I tried the following:
<telerik:RadNumericTextBox ID="originalNumber" runat="server" Label="Number"
Type="Number" DataType="long" NumberFormat-DecimalDigits="0" Width="250px" >
<ClientEvents OnValueChanged="squareValue" />
<NumberFormat DecimalDigits="0"></NumberFormat>
</telerik:RadNumericTextBox>
<telerik:RadNumericTextBox ID="squaredNumber" runat="server" Label="number Squared"
Type="Number" DataType="long" NumberFormat-DecimalDigits="0" Width="250px">
<NumberFormat DecimalDigits="0"></NumberFormat>
</telerik:RadNumericTextBox><br />
<
script type="text/javascript">
function squareValue(sender, eventArgs) {
originalValue = parseInt(document.getElementById(
"originalNumber").value);
document.getElementById(
"squaredNumber").value = originalValue * originalValue;
}
</
script>
The value changes, but it never changes on screen.
7 Answers, 1 is accepted

Since you are using RadControl (ajaxified control), you need to use $find() method instead of document.getElementByID(). Here is the sample code.
Javascript:
function
squareValue(sender, eventArgs)
{
var
valueTbx = $find(
'<%=squaredNumber.ClientID %>'
);
var
i=sender.get_value();
valueTbx.set_value(i*i);
}
Thanks,
Princy.

Thank You very much! That was exactly what I was missing!

when I do: this.SquaredNumber.Text, I get the original value, which is a blank string.


Same happened with me also. An opton to accomplish same functionality is using Enabled property instead of the ReadOnly. If you still want to use the ReadOnly Property then, save the readonly textbox's value in a HiddenField control (set value from client) and access it from the server side.
Thanks,
Princy.

Can i call a function like:
function
squareValue(sender, eventArgs)
Thanks,
Shweta
Generally, you can use this approach. However, it is not recommended if you will ajaxify your page:
http://encosia.com/the-easiest-way-to-break-aspnet-ajax-pages/
Please elaborate on what you are trying to achieve and on your specific scenario so we can suggest a proper approach.
Regards,
Eyup
the Telerik team