p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   .NET Framework 2.0 (http://p2p.wrox.com/forumdisplay.php?f=141)
-   -   Textbox GUI display different from it's .Text (http://p2p.wrox.com/showthread.php?t=55440)

mikehsu317 March 15th, 2007 03:31 PM

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

All times are GMT -4. The time now is 09:24 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.