0 Replies Latest reply on Aug 1, 2011 6:41 AM by rachelNS

    Creating a custom calculation for a grocery list

    rachelNS

      I am wanting to create a customized calculation for a grocery list form I have created. I want the user to be able to type the number of items they are purchasing and the text field to calculate all of the fields. The problem I am having is that I am very new to javascript and forms so I am not sure how to assign a value to the text field and then multiple that value by whatever the user enters.

       

       

       

      Ex:       Canned beans = $1.15 the user wants to buy 2. = $2.30

       

                  Canned fruit = $1.55 the user wants to buy 2 = $ 3.10

       

                                                                                 Total = 5.40

       

       

       

      So how can I add a value to a text field box, multiple it by whatever the user enters, and then add everything together for a total.

       

       

       

      Here is my form

       

       

       

      (1.15) Canned beans                            +_____________________

       

      (2.19) Canned ravioli                             +_____________________

       

      (2.29) Canned chili                               +_____________________

       

      (1.15) Canned soups                            +_____________________

       

      (2.29) Canned chicken                         +_____________________

       

      (1.55) Canned fruit                               +_____________________

       

      (1.05) Canned veggies                          +_____________________

       

      (1.29) Canned tuna                               +_____________________

       

       

       

                                                      Total    =_____________________

       

       

       

       

       

      Thank you for helping in any way!