<%@ Page Language="C#" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<script runat="server"> |
</script> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title>Example</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<asp:ScriptManager runat="server" EnablePartialRendering="true" /> |
<Telerik:RadProgressManager ID="ProgressManager1" runat="server" /> |
<Telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" EnableFileInputSkinning="false" InputSize="30" /> |
<Telerik:RadProgressArea ID="ProgressArea1" runat="server" /> |
<asp:Button ID="btnTest" runat="server" Text="Submit 1" /> |
</form> |
</body> |
</html> |
<httpHandlers> |
<remove verb="*" path="*.asmx"/> |
<add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI" validate="false"/> |
</httpHandlers> |
<httpModules> |
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/> |
</httpModules> |
<
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
>
<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?