3 Replies Latest reply on Jan 24, 2012 12:55 PM by Bill95722

    Scope/reference problem following removeInstance?

    Bill95722 Level 1

      This is related to my other post on removeInstance. It appears there is some other/bigger problem.

       

      To start over: I have a repeatable subform with Add and Delete buttons. After clicking on either button, I want to total a particular numeric field from each existing subform (I know this isn't necessary for an Add event but bear with me). I have put the totaling code in a Function (DoTotal) within a Script Object  (named Locals) so its common code.

       

      Upon Add Click:

           addInstance();

           Locals.DoTotal(); // Works Fine!

       

      Upon Delete Click

           removeInstance(integer);

           Locals.DoTotal(); // JS Debugger says "Locals is not defined"

       

      Thanks for any ideas!