Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Need Help

  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help

    Hello,
    I have a computer business that builds computers and i am trying to make a website. I need help with trying to add up all the fields. I.E. CPU + Video Card = Price you pay. Only i want more fields. Will somebody please help me.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <html>
    
    <head>
    
    <script>
    
    function addprices() {
    total = 0;
    for (x=0; x<document.form1.elements.length-1; x++) {
    temp = parseInt(document.form1.elements[x].value);
    total += temp;
    }
    document.form1.tot.value = (total)/100;
    }
    
    </script>
    
    </head>
    
    <body>
    <form name="form1">
      <select size="1" name="Part1" onchange="addprices();">
        <option selected value="0">CPU</option>
        <option value="0">AMD</option>
        <option value="8099">-Duron 1200</option>
        <option value="10000">-Duron 1300</option>
        <option value="18050">-Athlon XP 2000</option>
        <option value="28000">-Athlon XP 2200</option>
        <option value="0">Intel</option>
        <option value="13050">-Celeron 1200</option>
        <option value="18500">-Celeron 1800</option>
        <option value="30000">-P4 1.8</option>
        <option value="57000">-P4 2.4</option>
      </select><br>
      <select size="1" name="Part2" onchange="addprices();">
        <option selected value="0">Mother Board</option>
        <option value="0">ASUS</option>
        <option value="28050">-sdfgfdsg</option>
        <option value="30000">-sdfgfdsg</option>
        <option value="28099">-sdfgfdsg</option>
        <option value="18050">-fhbvbdf</option>
        <option value="0">GIGABYTE</option>
        <option value="23040">-lkklkl</option>
        <option value="38566">-jkllljkl</option>
        <option value="20099">-jkljkljk</option>
        <option value="17050">-jlklkljk</option>
        <option value="0">MSI</option>
        <option value="23050">-lkghjklkl</option>
        <option value="38599">-jklghjlljkl</option>
        <option value="20000">-jklghjjkljk</option>
        <option value="17068">-jlkghjlkljk</option>
      </select><br>
      <select size="1" name="Part3" onchange="addprices();">
        <option selected value="0">RAM</option>
        <option value="0">SDR</option>
        <option value="8040">-64</option>
        <option value="10079">-128</option>
        <option value="18099">-256</option>
        <option value="28059">-512</option>
        <option value="0">DDR</option>
        <option value="18550">-128</option>
        <option value="30099">-256</option>
        <option value="57059">-512</option>
      </select><br>
      <input type="text" name="tot">
    </form>
    
    </body>
    
    </html>
    Just add more select options BEFORE the total box and give them a new name. You don't need to follow the current patern.

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How about like with radio buttons.....i need something like alienware or dell's site.


  •  

    Posting Permissions

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