View Full Version : Need Help

08-24-2002, 02:23 AM
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.

08-24-2002, 03:15 AM



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;



<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 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 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>
<input type="text" name="tot">



Just add more select options BEFORE the total box and give them a new name. You don't need to follow the current patern.

08-24-2002, 03:56 AM
How about like with radio buttons.....i need something like alienware or dell's site.