2 Replies Latest reply on Apr 29, 2006 3:22 PM by Pylo

    Working out a financial quote from submission form

    Pylo
      Hi,

      I have perhaps rashly undertaken the challenge of developing a form for an accountant. The customer will input a range of numerical data and this will be processed into a final quote for a years services. The form is spread out over several frames to keep it visually clear.

      I have assigned the text input to _global variables and these are OK but I am having problems with numerical input. How do I refer to the inputted data (figure) in such a way that it is clear that the _global variable can subsequently be used to calculate the final quote?

      Thanks in advance

      Phill
        • 1. Re: Working out a financial quote from submission form
          Level 7
          > _global.wpr.text = this.wprt_txt.text; //--should assign inputted number
          > to global variable

          Not with text as a property of the variable, you'd want:

          _global.wpr = wpr_text.text; (this is most likely not needed here)

          A regular timeline variable would suffice as well though, you don't need
          globals. Also, you may want to use the parseFloat() method to insure the
          text is a float. One more thing, placing the numbers into an object will
          allow you to keep everything together more neatly, and allow you to label
          the data better - which you should do - variable names like wpr and mpr are
          not too good.

          var myData bject = new Object();
          //
          myData.wpr = parseFloat(wprt_text.text);
          myData.mpr = parseFloat(mprt_text.text);
          myData.fpr = parseFloat(fwpr_text.text);
          //
          var subTotal = myData.wpr + myData.mpr + myData.fpr;


          --
          Dave -
          Adobe Community Expert
          www.blurredistinction.com
          www.macromedia.com/support/forums/team_macromedia/


          • 2. Re: Working out a financial quote from submission form
            Pylo Level 1
            Thanks mate. I will continue to wrestle with this in the morning but I'm pretty sure that you have sorted this out for me now.

            Thanks again!

            Phill