View Single Post
  #1 (permalink)  
Old March 15th, 2007, 03:31 PM
mikehsu317 mikehsu317 is offline
Authorized User
Join Date: Oct 2004
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Textbox GUI display different from it's .Text

I have a couple of textboxes and when a user types in one of them I run javascript to update the other boxes. For a user stand point it works fine. However, when I debug it the textboxes, that textboxes that autoupdated through my javascript, their Textbox.Text field have the values in them before the autoupdate. It's weird because the Textbox that is not read only has the correct value in it's .Text field.

This originally worked in .Net 1.x, but when we moved it over to 2.0 it no longer worked.

I think that it may have somehting to do with the Javascript, but I'm not sure.

Here is the Javascript Function
function CalculateInventoryExposureLimit()
    var a = removeCurrency(document.getElementById('<%=txtCurr entOnOrderPosition.ClientID%>').value);
    var b = removeCurrency(document.getElementById('<%=txtCurr entOnHandPosition.ClientID%>').value);
    var c = removeCurrency(document.getElementById('<%=txtNewO rderExposure.ClientID%>').value);
    var f = removeCurrency(document.getElementById('<%=txtAREx posure.ClientID%>').value);

    var d = parseFloat(a) + parseFloat(b) + parseFloat(c);
    var g = parseFloat(a) + parseFloat(b) + parseFloat(c) + parseFloat(f);

    document.getElementById('<%=txtRequestedTotalInven toryExposureLimit.ClientID%>').value = formatCurrency(d.toFixed(0));
    document.getElementById('<%=txtCFCInventoryExposur eLimit.ClientID%>').value = formatCurrency(d.toFixed(0));
    document.getElementById('<%=txtTotalInventoryandAR Exposure.ClientID%>').value = formatCurrency(g.toFixed(0));
    document.getElementById('<%=txtNewOrderExposure.Cl ientID%>').value = formatCurrency(parseFloat(c).toFixed(0));

As it shows, txtCFCInventoryExposureLimit updates when the user blurs off and it shows correctly, but in the code behind txtCFCInventoryExposureLimit.Text shows something that is different.

Any help would be greatly apprciated.

Michael Hsu

Reply With Quote