Results 1 to 3 of 3

Thread: How to Calculate Total

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Calculate Total

    Hi,
    I've been trying for days and looked all over the internet, but still need help.

    I am a student and have created an order form for a fictitious company. I want to calculate products selected in 3 categories which are Collars, Tags & Clothes. I have included a box for quantity for each category.
    I need to show a total cost in a message box at the end of the form.

    This is the relevant part of the form.

    <td> <b>Collars</b></td>
    </tr>
    <tr>
    <td><select name=products>
    <option>Please select style
    <option value="$39.99">Collar Pink Leather $39.99
    <option value="$44.99">Collar White Rhinestones $44.99
    <option value= "$44.99">Collar Pet Name $44.99
    <option value="$24.99">Collar Flower Jewels $24.99
    </select></td>
    <td><b>Quantity<b>
    <input type=hidden name="Item" value="Name">
    <input type=text name="Qty" value="1" size="3">
    <input type=hidden name="Price" value="10">

    </td>
    </tr>
    <tr><td><br></td></tr>
    <tr>
    <td> <b>Tags</b></td>
    </tr>
    <tr>
    <td><select name=Tags>
    <option>Please select style
    <option value="$39.99">Rhinestone Bone $24.99
    <option value="$44.99">Black & Silver Bone $24.99
    <option value= "$44.99">Red Dog Paw $24.99
    <option value="$24.99">Black Dog Paw $24.99
    </select></td>
    <td><b>Quantity<b>
    <input type=hidden name="Item" value="Name">
    <input type=text name="Qty" value="1" size="3">
    <input type=hidden name="Price" value="10">
    </td>
    </tr>
    <tr><td><br></td></tr>
    <tr>
    <td> <b>Clothes</b></td>
    </tr>
    <tr>
    <td><select name=Clothes>
    <option>Please select style
    <option value="$39.99">Wedding Dress $99.99
    <option value="$44.99">Flower Jumper $49.99
    <option value= "$44.99">Polka Dot Dress $35.99
    <option value="$24.99">Lucky Dog T-Shirt $24.99
    </select></td>
    <td><b>Quantity<b>
    <input type=hidden name="Item" value="Name">
    <input type=text name="Qty" value="1" size="3">
    <input type=hidden name="Price" value="10">
    </td>

    Can anyone out there help me.
    Thank you.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Lemme get this straight, as people select there options, you want the value in the total changed?
    This can be done with a simple javascript function.
    But, I don't want to make it till you clarify that this is what you want.
    Jeremy | jfein.net

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Please refer to #8 on Posting Policies and Regulations


    take the values of the three categories and add them together and put them in a fourth box


    Nile... This is most likely a homework assignment, since she said she was a student so let her try to figure it out herself.
    Sara if you have questions about how to get the value of an input refer to the javascript function getElementById

Bookmarks

Posting Permissions

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