hemy2000 Posted June 24, 2006 Share Posted June 24, 2006 Hi im trying to make a page where you can customise a computer and it updates a price at the bottom when you you pick different options from a drop form. Kind of like this page does but without radio buttons, [a href=\"http://www.kobaltcomputers.co.uk/acatalog/apacheX.html\" target=\"_blank\"]http://www.kobaltcomputers.co.uk/acatalog/apacheX.html[/a]How do I do it.Heres the code I have for the customise page:[code]<?phpinclude "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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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: </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">£000.00</span><br /> <br /> <input type="image" src="images/buttons/continue.gif" alt="Continue" name="continue"> <br /> <br /></div></div><?phpinclude "footer.inc.php";?>[/code][b]EDITED BY WILDTEEN88: PLEASE USE CODE TAGS WHEN SUBMITTING CODE[/b] Link to comment https://forums.phpfreaks.com/topic/12800-form-price-update/ Share on other sites More sharing options...
ale_jrb Posted June 24, 2006 Share Posted June 24, 2006 To update things live, you have to use a client side script such as Javascript - PHP cannot validate things until the submit button is pressed, which if I understood correctly, is not what you want. Link to comment https://forums.phpfreaks.com/topic/12800-form-price-update/#findComment-49094 Share on other sites More sharing options...
hemy2000 Posted June 24, 2006 Author Share Posted June 24, 2006 How would i do it using javascript? Link to comment https://forums.phpfreaks.com/topic/12800-form-price-update/#findComment-49150 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.