title: JavaScript Function Not Defined Error (BUT IT IS DEFINED)
body: <p>I have a JavaScript function which fires on blur. Strangely enough it worked fine the first time I ran it, and ever since then I've been getting an error that says JavaScript Function Not Defined - and it stops running. I have googled around similar problems but none of the advice has been able to resolve the issue. Asp.Net 3.5 Webforms, if it matters. I have included some extra functions and lines of code which may be unrelated to the problem. The issue I'm having regards updateFiscalGrid, the large function. The HTML which binds to the event is below the function. </p>
  
  <pre><code>&lt;%@ Page MasterPageFile="~/MasterPages/NPRPage.Master"  CodeBehind="NPRFundingApplication.aspx.cs" Inherits="Tea.Hcf.Web.Secured.NPRFundingApplication" AutoEventWireup="true" Language="C#" EnableEventValidation="true" MaintainScrollPositionOnPostback="true" %&gt;
  
  &lt;%@ Register TagPrefix="ew" Namespace="eWorld.UI" Assembly="eWorld.UI" %&gt;
  &lt;%@ Register TagPrefix="hcf" Namespace="Tea.Hcf.Web" Assembly="Tea.Hcf.Web" %&gt;
  &lt;%@ Register Src="../Controls/NpCdnSearch.ascx" TagName="NpCdnSearch" TagPrefix="np1" %&gt;
  &lt;%@ Register Src="../Controls/NpStudentRoster.ascx" TagName="NpStudentRoster" TagPrefix="np2" %&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
      //&lt;![CDATA[
  
      function showMaxWin(nUrl) {
          var h = 600;
          var w = 800;
          var features = 'resizable=1, width=' + w + ', height=' + h + ', top=0, left=0';
          NewWin = window.open(nUrl, 'NewWin', features);
      }
  
      function dateChangedCallback() {
          updateSubTotals();
      }
  
      function updateFiscalGrid(){
          var RelatedServicesCost = document.getElementById('&lt;%= RPCB_SUPP_SVCS_SUBTOTAL3.ClientID %&gt;').value;
          var ResidentialCare = document.getElementById('&lt;%= RPCB_RES_SVCS_SUBTOTAL3.ClientID %&gt;').value;
          var TotalCostforResPlacement = document.getElementById('&lt;%= TotalResidentialPlacement.ClientID %&gt;').value;
          var SetAside = document.getElementById('&lt;%= rblSetAsideMet.ClientID %&gt;').value;
          var LocalTaxSubtraction = document.getElementById('&lt;%= LocalTaxShareSubtraction.ClientID %&gt;').value;
          var IDEABRelatedServiceCost = document.getElementById('&lt;%= RelatedServicesSetAside.ClientID %&gt;').value;
          var IDEABDiscretionaryServicesCost = document.getElementById('&lt;%= RelatedServicesDiscretionary.ClientID %&gt;').value;
          var IDEABREsidentialCare = document.getElementById('&lt;%= ResidentialCareSetAside.ClientID %&gt;').value;
          var IDEABDiscResCare = document.getElementById('&lt;%= ResidentialCareDiscretionary.ClientID %&gt;').value;
          var StateFSP = document.getElementById('&lt;%= TotalEducationServices2.ClientID %&gt;').value;
          var Discretionary = document.getElementById('&lt;%= DiscretionaryTotal.ClientID %&gt;').value;
          var IDEABAward = document.getElementById('&lt;%= IdeaBAward.ClientID %&gt;').value;
          if(SetAside = '0'){
              Discretionary = LocalTaxSubtraction + IDEABRelatedServiceCost + IDEABDiscretionaryServicesCost + IDEABREsidentialCare + IDEABDiscResCare;
          }
          else {
              Discretionary = LocalTaxSubtraction + IDEABDiscretionaryServicesCost + IDEABDiscResCare;
          }
          IDEABAward = (RelatedServicesCost + ResidentialCare + TotalCostforResPlacement) - Number(Discretionary));
          //IDEABAward = (Number(RelatedServicesCost) + Number(ResidentialCare) + Number(TotalCostforResPlacement)) - Number(Discretionary));
          document.getElementById('&lt;%= DiscretionaryTotal.ClientID %&gt;').value = Discretionary;
          document.getElementById('&lt;%= IdeaBAward.ClientID %&gt;').value = IDEABAward;
      }
  
  
      //]]&gt;
  &lt;/script&gt;
  
  
  
  
      &lt;td&gt;
          &lt;hcf:CurrencyBox ID="LocalTaxShareSubtraction" OnBlur= "updateFiscalGrid();" Precision="2" runat="server" /&gt;
      &lt;/td&gt;
  </code></pre>