...

View Full Version : Update Price



hemy2000
06-25-2006, 01:37 PM
Hey, I was wondering what code I would need to make an auto price update using form drop menus. Like on Dells Site - http://configure.euro.dell.com/dellstore/config.aspx?b=&c=uk&cs=ukdhs1&l=en&oc=D063C5&rbc=D063C5&s=dhs&sbc=ukdhsrsdimen_3100c_3

But they use radio buttons instead. Anyway heres the code for the customise page any help would be great:

<?php
include "header.inc.php";
?>
<style type="text/css">
<!--
.style1 {
color: #FF6600;
font-size: 18px;
}
-->
</style>
<div id="content">
<div class="title">
<h1>-Home/Office-</h1>
</div>
<div class="custom">
<h3>Cases</h3>
<img src="images/computers/cases.jpg" alt="Cases" height="200" width="740"/><br />
<br />
</div>
<div class="full_">
<h3 align="center">Available Options:</h3>
<form method="post" action="order_send.php">
<table border="0" cellpadding="0" cellspacing"0" align="center">
<tr>
<td align="right">Case:&nbsp;</td>
<td><select name="case" onChange="updatePrice(this)">
<option price="0">A-Pod Case Black - 400 watt PSU (+26.55)</option>
<option price="28">A-Pod Case White - 400 watt PSU (+27.93)</option>
<option price="34">X-Blade Black Case - 450 watt PSU (+33.54)</option>
<option price="35">Gladiator Case Silver/Black - 500 watt PSU (+34.88)</option>
<option price="42">Asus TA-210 Black Case - 360 watt PSU (+41.68)</option>
<option price="53">CoolerMaster Centurion 534 - 450 watt PSU (+52.58)</option>
<option price="56">CoolerMaster Cavalier 3 - 450 watt PSU (+55.69)</option>
<option price="81">Chieftec Mesh LCX-01 Blue - 410 watt PSU (+80.87)</option>
<option price="98">Lian Li PC-6289 - 450 watt PSU (+97.38)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Power Supply:&nbsp;</td>
<td><select name="power_supply" onChange="updatePrice(this)">
<option price="0">300w truepower PSU (+9.39)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Motherboard:&nbsp;</td>
<td><select name="motherboard" onChange="updatePrice(this)">
<option price="0">Gigabyte GA-K8N51GMF nForce410 (+39.80)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Processor:&nbsp;</td>
<td><select name="processor" onChange="updatePrice(this)">
<option price="0">2800+ AMD Sempron 64-bit - (Select Socket 754 motherboard) (+51.00)</option>
<option price="87">3000+ AMD Athlon 64-bit - (Select Socket 754 motherboard) (+86.98)</option>
<option price="128">3500+ AMD Athlon 64-bit - (Select Socket 939 motherboard) (+127.89)</option>
<option price="218">3800+ AMD Athlon 64 X2 (Dual) - (Select Socket 939 motherboard) (+217.77)</option>
<option price="468">4800+ AMD Athlon 64 X2 (Dual) - (Select Socket 939 motherboard) (+467.38)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Graphics:&nbsp;</td>
<td><select name="graphics" onChange="updatePrice(this)">
<option price="0">Onboard Graphics - (Select `with Onboard Graphics' in Mainboard option list)</option>
<option price="22">AGP - 64MB Inno3D MX4000 - (Not for AMD Socket 939 cpu's) (+21.87)</option>
<option price="35">PCI-E - 256MB Inno3D 6200 TurboCache (+34.58)</option>
<option price="65">PCI-E - 256MB Sparkle GeForce 6600 (+64.55)</option>
<option price="102">PCI-E - 256MB XFX GeForce 7600GS XT (+101.97)</option>
<option price="133">PCI-E - 256MB Inno3D GeForce 7600GT (+132.96)</option>
<option price="224">PCI-E - 256MB Sparkle GeForce 7900GT (+223.68)</option>
<option price="287">PCI-E - 2x (SLI) 256MB Inno3D 7600GT - (Select SLI mainboard) (+286.96)</option>
<option price="447">PCI-E - 2x (SLI) 256MB Sparkle 7900GT - (Select SLI mainboard) (+446.36)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Hard Drive 1:&nbsp;</td>
<td><select name="hard_drive_1" onChange="updatePrice(this)">
<option price="0">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option price="49">160GB Maxtor SATA II (+48.97)</option>
<option price="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option price="62">250GB Western Digital Caviar SE (+61.22)</option>
<option price="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option price="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option price="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Hard Drive 2:&nbsp;</td>
<td><select name="hard_drive_2" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option price="49">160GB Maxtor SATA II (+48.97)</option>
<option price="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option price="62">250GB Western Digital Caviar SE (+61.22)</option>
<option price="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option price="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option price="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Cd/Dvd Drive 1:&nbsp;</td>
<td><select name="optical_drive_1" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option price="49">160GB Maxtor SATA II (+48.97)</option>
<option price="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option price="62">250GB Western Digital Caviar SE (+61.22)</option>
<option price="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option price="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option price="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Cd/Dvd Drive 2:&nbsp;</td>
<td><select name="optical_drive_2" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option price="49">160GB Maxtor SATA II (+48.97)</option>
<option price="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option price="62">250GB Western Digital Caviar SE (+61.22)</option>
<option price="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option price="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option price="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Floppy Drive/Card Reader:&nbsp;</td>
<td><select name="removable_storage" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="8">Floppy Disk Drive Black (+7.48)</option>
<option price="8">Floppy Disk Drive Silver (+7.48)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Sound Card:&nbsp;</td>
<td><select name="sound_card" onChange="updatePrice(this)">
<option price="0">Onboard Sound</option>
<option price="12">Genius Sound Maker 5.1 V2 (+11.48)</option>
<option price="41">Sound Blaster Audigy 4 7.1 (+40.12)</option>
<option price="128">Terratec Aureon 7.1 Universe (+127.12)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Keyboard:&nbsp;</td>
<td><select name="keyboard" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Mouse:&nbsp;</td>
<td><select name="mouse" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Speakers:&nbsp;</td>
<td><select name="speakers" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Monitor:&nbsp;</td>
<td><select name="monitor" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option price="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Operating System:&nbsp;</td>
<td><select name="operating_system" onChange="updatePrice(this)">
<option price="0">Not Required</option>
<option price="57">Microsoft Windows XP Home - (Installed for free) (+56.58)</option>
<option price="94">Microsoft Windows XP Professional - (Installed for free) (+93.08)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Building Fee:&nbsp;</td>
<td><select name="building_fee" onChange="updatePrice(this)">
<option price="0">Building and Testing (+25)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Parts Shipping:&nbsp;</td>
<td><select name="parts_shipping" onChange="updatePrice(this)">
<option price="0">Standard shipping (+5.79)</option>
</select>
</td>
</tr>
</table>
<br />
</div>
<div align="center"> <span class="style1" id="price">300</span><br />
<br />
<input type="image" src="images/buttons/continue.gif" alt="Continue" name="continue">
<br />
<br />
</div>
</div>
<?php
include "footer.inc.php";
?>

vwphillips
06-25-2006, 02:49 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function zxcAddEvents(zxcid,zxcpid){
var zxcp=document.getElementById(zxcid);
zxcp.ary=[document.getElementById(zxcpid)];
var zxcsels=zxcp.getElementsByTagName('SELECT');
for (var zxc0=0;zxc0<zxcsels.length;zxc0++){
zxcp.ary.push(zxcsels[zxc0]);
zxcsels[zxc0].ary=zxcp.ary;
zxcsels[zxc0].selectedIndex=0;
zxcAddEvt(zxcsels[zxc0],'zxcCalculate','change')
}
zxcCalculate('zxce',zxcsels[1]);
}


function zxcCalculate(zxce,zxcobj){
var zxcobj=zxcobj||this;
var zxctotal=300;
for (var zxc0=1;zxc0<zxcobj.ary.length;zxc0++){
zxctotal+=zxcobj.ary[zxc0].value*1;
}
zxcobj.ary[0].innerHTML=' '+zxctotal;
}


function zxcEventAdd(zxco,zxct,zxcf) {
if ( zxco.addEventListener ){ zxco.addEventListener(zxct, function(e){ zxco[zxcf](e);}, false); }
else if ( zxco.attachEvent ){ zxco.attachEvent('on'+zxct,function(e){ zxco[zxcf](e); }); }
else {
var zxcPrev=zxco["on" + zxct];
if (zxcPrev){ zxco['on'+zxct]=function(e){ zxcPrev(e); zxco[zxcf](e); }; }
else { zxco['on'+zxct]=zxco[zxcf]; }
}
}


var zxcEvt=0;

function zxcAddEvt(zxco,zxcfun,zxcevt){
if (zxco['zxc'+zxcfun+zxcevt]){ return; }
zxco['zxcaddEvt'+zxcEvt]=window[zxcfun];
zxco['zxc'+zxcfun+zxcevt]=true;
zxcEventAdd(zxco,zxcevt,'zxcaddEvt'+zxcEvt);
zxcEvt++;
}

function updatePrice(){

}

/*]]>*/
</script></head>

<body onload="zxcAddEvents('content','price')" >

<style type="text/css">
<!--
.style1 {
color: #FF6600;
font-size: 18px;
}
-->
</style>
<div id="content">
<div class="title">
<h1>-Home/Office-</h1>
</div>
<div class="custom">
<h3>Cases</h3>
<img src="images/computers/cases.jpg" alt="Cases" height="200" width="740"/><br />
<br />
</div>
<div class="full_">
<h3 align="center">Available Options:</h3>
<form method="post" action="order_send.php">
<table border="0" cellpadding="0" cellspacing"0" align="center">
<tr>
<td align="right">Case:&nbsp;</td>
<td><select name="case" onChange="updatePrice(this)">
<option value="0">A-Pod Case Black - 400 watt PSU (+26.55)</option>
<option value="28">A-Pod Case White - 400 watt PSU (+27.93)</option>
<option value="34">X-Blade Black Case - 450 watt PSU (+33.54)</option>
<option value="35">Gladiator Case Silver/Black - 500 watt PSU (+34.88)</option>
<option value="42">Asus TA-210 Black Case - 360 watt PSU (+41.68)</option>
<option value="53">CoolerMaster Centurion 534 - 450 watt PSU (+52.58)</option>
<option value="56">CoolerMaster Cavalier 3 - 450 watt PSU (+55.69)</option>
<option value="81">Chieftec Mesh LCX-01 Blue - 410 watt PSU (+80.87)</option>
<option value="98">Lian Li PC-6289 - 450 watt PSU (+97.38)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Power Supply:&nbsp;</td>
<td><select name="power_supply" onChange="updatePrice(this)">
<option value="0">300w truepower PSU (+9.39)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Motherboard:&nbsp;</td>
<td><select name="motherboard" onChange="updatePrice(this)">
<option value="0">Gigabyte GA-K8N51GMF nForce410 (+39.80)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Processor:&nbsp;</td>
<td><select name="processor" onChange="updatePrice(this)">
<option value="0">2800+ AMD Sempron 64-bit - (Select Socket 754 motherboard) (+51.00)</option>
<option value="87">3000+ AMD Athlon 64-bit - (Select Socket 754 motherboard) (+86.98)</option>
<option value="128">3500+ AMD Athlon 64-bit - (Select Socket 939 motherboard) (+127.89)</option>
<option value="218">3800+ AMD Athlon 64 X2 (Dual) - (Select Socket 939 motherboard) (+217.77)</option>
<option value="468">4800+ AMD Athlon 64 X2 (Dual) - (Select Socket 939 motherboard) (+467.38)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Graphics:&nbsp;</td>
<td><select name="graphics" onChange="updatePrice(this)">
<option value="0">Onboard Graphics - (Select `with Onboard Graphics' in Mainboard option list)</option>
<option value="22">AGP - 64MB Inno3D MX4000 - (Not for AMD Socket 939 cpu's) (+21.87)</option>
<option value="35">PCI-E - 256MB Inno3D 6200 TurboCache (+34.58)</option>
<option value="65">PCI-E - 256MB Sparkle GeForce 6600 (+64.55)</option>
<option value="102">PCI-E - 256MB XFX GeForce 7600GS XT (+101.97)</option>
<option value="133">PCI-E - 256MB Inno3D GeForce 7600GT (+132.96)</option>
<option value="224">PCI-E - 256MB Sparkle GeForce 7900GT (+223.68)</option>
<option value="287">PCI-E - 2x (SLI) 256MB Inno3D 7600GT - (Select SLI mainboard) (+286.96)</option>
<option value="447">PCI-E - 2x (SLI) 256MB Sparkle 7900GT - (Select SLI mainboard) (+446.36)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Hard Drive 1:&nbsp;</td>
<td><select name="hard_drive_1" onChange="updatePrice(this)">
<option value="0">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option value="49">160GB Maxtor SATA II (+48.97)</option>
<option value="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option value="62">250GB Western Digital Caviar SE (+61.22)</option>
<option value="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option value="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option value="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Hard Drive 2:&nbsp;</td>
<td><select name="hard_drive_2" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option value="49">160GB Maxtor SATA II (+48.97)</option>
<option value="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option value="62">250GB Western Digital Caviar SE (+61.22)</option>
<option value="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option value="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option value="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Cd/Dvd Drive 1:&nbsp;</td>
<td><select name="optical_drive_1" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option value="49">160GB Maxtor SATA II (+48.97)</option>
<option value="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option value="62">250GB Western Digital Caviar SE (+61.22)</option>
<option value="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option value="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option value="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Cd/Dvd Drive 2:&nbsp;</td>
<td><select name="optical_drive_2" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
<option value="49">160GB Maxtor SATA II (+48.97)</option>
<option value="55">200GB Maxtor DiamondMax 10 SATA II (+54.99)</option>
<option value="62">250GB Western Digital Caviar SE (+61.22)</option>
<option value="78">300Gb Maxtor DiamondMax (+77.79)</option>
<option value="122">400GB Maxtor DiamondMax 11 (+121.97)</option>
<option value="193">500GB Western Digital Caviar SE 16 (+192.94)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Floppy Drive/Card Reader:&nbsp;</td>
<td><select name="removable_storage" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="8">Floppy Disk Drive Black (+7.48)</option>
<option value="8">Floppy Disk Drive Silver (+7.48)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Sound Card:&nbsp;</td>
<td><select name="sound_card" onChange="updatePrice(this)">
<option value="0">Onboard Sound</option>
<option value="12">Genius Sound Maker 5.1 V2 (+11.48)</option>
<option value="41">Sound Blaster Audigy 4 7.1 (+40.12)</option>
<option value="128">Terratec Aureon 7.1 Universe (+127.12)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Keyboard:&nbsp;</td>
<td><select name="keyboard" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Mouse:&nbsp;</td>
<td><select name="mouse" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Speakers:&nbsp;</td>
<td><select name="speakers" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Monitor:&nbsp;</td>
<td><select name="monitor" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="32">40GB Maxtor DiamondMax IDE (+31.86)</option>
<option value="35">80GB ExcelStor ESJ880S SATA II (+34.72)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Operating System:&nbsp;</td>
<td><select name="operating_system" onChange="updatePrice(this)">
<option value="0">Not Required</option>
<option value="57">Microsoft Windows XP Home - (Installed for free) (+56.58)</option>
<option value="94">Microsoft Windows XP Professional - (Installed for free) (+93.08)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Building Fee:&nbsp;</td>
<td><select name="building_fee" onChange="updatePrice(this)">
<option value="25">Building and Testing (+25)</option>
</select>
</td>
</tr>
<tr>
<td align="right">Parts Shipping:&nbsp;</td>
<td><select name="parts_shipping" onChange="updatePrice(this)">
<option value="5.79">Standard shipping (+5.79)</option>
</select>
</td>
</tr>
</table>
<br />
</div>
<div align="center"> <span class="style1" id="price">300</span><br />
<br />
<input type="image" src="images/buttons/continue.gif" alt="Continue" name="continue">
<br />
<br />
</div>
</div></body>
</html>

hemy2000
06-25-2006, 07:08 PM
Thankyou, Iv been trying to find something like this for ages, it works great. Your a genius.

Tom.......



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum