3 Replies Latest reply on Dec 6, 2009 10:26 AM by funkysoul

    Checkbox and tax calculation

    jeeepU Level 1

      Hello All,

           I have the following:

      Quantities 1-5

      Unit Cost 1-5

      Sub Total 1-5

      Tax Checkbox 1-5

      Total Tax

       

      When I check "Tax Checkbox 1" and "Tax Checkbox 2" I want to be able to calculate the tax for "Sub Total 1" + "Sub Total 2" and place the tax total in a text field. I have tried several different ways to no avil. Can someone suggest the proper method of doing this? Thank you.

        • 1. Re: Checkbox and tax calculation
          Gregory Lafrance Level 6

          I don't clearly understand what is in your checkboxes and what you want to do.

           

          Please provide a more clear description and an answer should come soon.

          • 2. Re: Checkbox and tax calculation
            jeeepU Level 1

            I am trying to make an invoice script that sends invoice data to the database. There is a Quantity text box, Item Description text box, Unit price text box, Subtotal text box and Tax checkbox. The Tax checkbox is present since not all things have to be taxed, but if they do the Tax checkbox needs to be checked so that the subtotal can be multiplied by the certain tax percentage. I need to be able to detect all of the checkboxs that are checked multiply them by their subtotals and then add all of these values together in the Tax Total text box.

            • 3. Re: Checkbox and tax calculation
              funkysoul Level 4

              well to be honest, a proper solution can only be made if we are able to see what you already wrote and how you setup your checkboxes.


              but.. here's a hint:

               

              put a change event on every checkbox that calls up the calculate method, in the calculate method you switch/case the name of the checkbox and calculate based on the result of the selected checkbox, does this make sense?

               

              Otherwise you can post your code here, and I will see what i can do