Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. javascript calculation total not working

javascript calculation total not working

Scheduled Pinned Locked Moved Database
javascripthtmlcomsalestools
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    esebagel
    wrote on last edited by
    #1

    I can't get the Total box to calculate. I am trying to create an online invoice for my customer to print from my webpage. I have scoured the internet looking for some help, but it doesn't help that I am clueless about javascript. This is what I have tried: In my table, all I want to happen is for the user to type in a price in the Amount boxes and then have a total at the bottom. Seems pretty basic, but I just don't understand why it won't work (not really sure of what I am doing) Can somebody please help me? The form itself can be found at www.ahtcsonline.com/invoice.html Thank you in advance, Evan <script type="text/javascript"> function totalamountdue(){ { var amount, amount2, amount3, amount4, amount5, amount6, amount7, amount8, amount9, amount10; Amount = document.Invamt.Amount.value; Amount2 = document.Invamt.Amount2.value; Amount3 = document.Invamt.Amount3.value; Amount4 = document.Invamt.Amount4.value; Amount5 = document.Invamt.Amount5.value; Amount6 = document.Invamt.Amount6.value; Amount7 = document.Invamt.Amount7.value; Amount8 = document.Invamt.Amount8.value; Amount9 = document.Invamt.Amount9.value; Amount10 = document.Invamt.Amount10.value; Total = document.Invamt.Total.value; document.Invamt.Total.value = (amount + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10); } } </script> </head> <table width="738" border="1"> <tr class="Title-centered"> <td width="214" align="left"><div align="center"><strong>Name of Attendee</strong></div></td> <td width="229"><div align="center"><strong>Description</strong></div></td> <td width="118"><div align="center"><strong>Amount</strong></div></td> </tr> <tr> <td><div align="center"><span class="style15"> <input name="name" type="text" class="Input_box" id="name" size="40" /> </span></div></td> <td><div align="center"><span class="style12"> <select name="select_class" class="Input_box" id="select_class"> <option selected="selected">--Select a Class-- </option> <option>TRACS 202c</option>

    I 1 Reply Last reply
    0
    • E esebagel

      I can't get the Total box to calculate. I am trying to create an online invoice for my customer to print from my webpage. I have scoured the internet looking for some help, but it doesn't help that I am clueless about javascript. This is what I have tried: In my table, all I want to happen is for the user to type in a price in the Amount boxes and then have a total at the bottom. Seems pretty basic, but I just don't understand why it won't work (not really sure of what I am doing) Can somebody please help me? The form itself can be found at www.ahtcsonline.com/invoice.html Thank you in advance, Evan <script type="text/javascript"> function totalamountdue(){ { var amount, amount2, amount3, amount4, amount5, amount6, amount7, amount8, amount9, amount10; Amount = document.Invamt.Amount.value; Amount2 = document.Invamt.Amount2.value; Amount3 = document.Invamt.Amount3.value; Amount4 = document.Invamt.Amount4.value; Amount5 = document.Invamt.Amount5.value; Amount6 = document.Invamt.Amount6.value; Amount7 = document.Invamt.Amount7.value; Amount8 = document.Invamt.Amount8.value; Amount9 = document.Invamt.Amount9.value; Amount10 = document.Invamt.Amount10.value; Total = document.Invamt.Total.value; document.Invamt.Total.value = (amount + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10); } } </script> </head> <table width="738" border="1"> <tr class="Title-centered"> <td width="214" align="left"><div align="center"><strong>Name of Attendee</strong></div></td> <td width="229"><div align="center"><strong>Description</strong></div></td> <td width="118"><div align="center"><strong>Amount</strong></div></td> </tr> <tr> <td><div align="center"><span class="style15"> <input name="name" type="text" class="Input_box" id="name" size="40" /> </span></div></td> <td><div align="center"><span class="style12"> <select name="select_class" class="Input_box" id="select_class"> <option selected="selected">--Select a Class-- </option> <option>TRACS 202c</option>

      I Offline
      I Offline
      i j russell
      wrote on last edited by
      #2

      The Web Development forum might be a better place for this.

      E 1 Reply Last reply
      0
      • I i j russell

        The Web Development forum might be a better place for this.

        E Offline
        E Offline
        esebagel
        wrote on last edited by
        #3

        Sorry for posting in the wrong area. I corrected this by post in the suggested area of Web Development. Thank you for correcting me. Evan

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups