adding up numbers in a web form

Discussion in 'JavaScript' started by deb0and, Dec 13, 2013.

  1. #1
    Hello,

    I am struggling with javascript. I have an input box and would like it when numbers are inserted it will add them together defined on a set number.

    So for example a price set at £50 when 2 is entered it shows the sum of £100. The part of my form is below when I would like to implement this functionality.

    <div class="controls">
                    <input type="text" placeholder="How many would you like?" id="ENI_WHtest_ipCount" class="inputWide" maxlength="30">
                </div>
    Code (markup):

     
    deb0and, Dec 13, 2013 IP
  2. mrpixel

    mrpixel Member

    Messages:
    433
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #2
    could you be more specific? you have a defined price set(50) and the number you add in input is the "quantity"(2) outputting 100?
     
    mrpixel, Dec 15, 2013 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    PoPSiCLe, Dec 15, 2013 IP