Results 1 to 2 of 2
  1. #1

    Calculation in a table.

    Hey Guys,

    Could anybody give me a piece of code that will show the answer of a quantity entered by a user then multiplyed by a set price/number? I would like the total to automatically be shown.

    I'v designed a table in HTML and i want to add a this functionality to it. I thing javascipt would be best but dont know much about it.
    Here is the code for the table i designed and i want to get it in here somehow:

    <table width="654" height="64" border="3" align="center" bordercolor="#BEDEC6">
    <td width="260" height="26"><div align="left"><span class="style18">Ageratum</span></div></td>
    <td width="152"><span class="style18">2.50 euro</span></td>
    <td width="113"><input size=7 name="Quantity" value=""></td>
    <td width="97"> </td>
    <td height="26"><div align="left"><span class="style18">Alyssum</span></div></td>
    <td><span class="style18">2.50 euro</span></td>
    <td><input size=7 name="Quantity" value=""></td>
    <td> </td>

    Been struggling with this for a while now!
    A bit of help would be great.


  2. #2
    Join Date
    Mar 2005
    just a simple one

    var multi = + document.getElementById("multi_sel").value;
    var total = 99.9 * multi

    just include multi_sel into your drop down form for multipulation and

    <script type="text/javascript" src="javaname.js"></script>

    into your html script to load the script. and var total will be your accumulated field.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts