Okay, let me carry forward what F-ES Sitecore is saying about the using debugger.
Do the following code, and in browser press
F12 and run this function. It'll be paused at the very first line.
Now use the
F10 to step into in it and see what is actually happening with your code.
<script lang="javascript" type="text/javascript">
function sum() {
debugger;
var TextBoxFirstScoreAnc = document.getElementById('<%= TextBoxFirstScoreAnc.ClientID%>').value;
var TextBoxAncillaryNonPatScore = document.getElementById('<%= TextBoxAncillaryNonPatScore.ClientID%>').value;
var TextBoxRestroomScoreAnc = document.getElementById('<%= TextBoxRestroomScoreAnc.ClientID%>').value;
var TextBoxDustingScoreAnc = document.getElementById('<%= TextBoxDustingCommentsAnc.ClientID%>').value;
var TextBoxFloorScoreAnc = document.getElementById('<%= TextBoxFloorScoreAnc.ClientID%>').value;
if ((TextBoxFirstScoreAnc !== "") && (TextBoxAncillaryNonPatScore !== "") && (TextBoxRestroomScoreAnc !== "") && (TextBoxDustingScoreAnc !== "") && (TextBoxFloorScoreAnc !== "")) {
var newValue = GetDecimalValue(TextBoxFirstScoreAnc) + GetDecimalValue(TextBoxAncillaryNonPatScore) + GetDecimalValue(TextBoxRestroomScoreAnc) + GetDecimalValue(TextBoxDustingScoreAnc) + GetDecimalValue(TextBoxFloorScoreAnc);
document.getElementById('<%= TextBoxTotalScoreAnc.ClientID%>').value = GetDecimalValue(newValue);
}
}
function GetDecimalValue(value) {
return (value ? parseFloat(value).toFixed(1) : 0.0);
}
</script>
-KR