Here is the layout of the javascript
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function setTotal() {
var radCostF = 0;
var radPercentF = 0;
var radTotal;
var radLength = document.getElementsByTagName("INPUT");
var strToFind = "TEMPCOST";
for (i = 0; i <
radLength.length
; i++) {
var
element
=
radLength
[i];
strToFind
=
"TEMPCOST"
;
if (element.id.indexOf(strToFind) >= 0) {
if (element.id.lastIndexOf(strToFind) + strToFind.length == element.id.length) {
alert(element.id + "=" + element.value);
radCostF = element.value;
}
}
strToFind = "TEMPPCT";
if (element.id.indexOf(strToFind) >= 0) {
if (element.id.lastIndexOf(strToFind) + strToFind.length == element.id.length) {
alert(element.id + "=" + element.value);
radPercentF = element.value;
}
}
strToFind = "TOTAL";
if (element.id.indexOf(strToFind) >= 0) {
if (element.id.lastIndexOf(strToFind) + strToFind.length == element.id.length) {
element.value = radCostF * radPercentF / 100;
}
}
}
}
</
script
>
</
telerik:RadCodeBlock
>
In the user control the code is such
<td>
Total:
<br />
<telerik:RadNumericTextBox NumberFormat-DecimalDigits="2" ID="TEMPCOST" runat="server"
Value= '<%#CheckNumericNull(DataBinder.Eval(Container, "DataItem.TEMPCOST"))%>' >
<ClientEvents OnBlur="setTotal" />
</telerik:RadNumericTextBox>
</td>
<
td>
Total:
<br />
<telerik:RadNumericTextBox NumberFormat-DecimalDigits="2" type="Currency" ID="TOTAL" runat="server"
ReadOnly="true" Value="0.00" />
</td>
The event OnBlur fires and I can read the values from the source controls and set the value of the target (TOTAL) but the value is not reflected to the user. In other words if I set the value of TempCost to 100 and Percent to 10 then when I pass through the same code again, the value of the TOTAL field is 10 but screen still shows 0 even after the event has fired. Any thoughts as to why the screen is not displaying the updated value?