Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-18-2006, 10:42 AM   #1
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Custom Computer Ordering System,

Hi,

I am having trouble with some javascript and html, i want it so when someone chooses something off a list, a price at the bottom of the page updates itself for upgrades. all i know is i need a little javascript, but i dont know it.

My code so far is:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SR COMPUTERS INTEL PACKAGES ORDER</title>

</head>
<body bgcolor="#3399FF">
<center>
<h3><u>Order Home Package</u></h3></center>
<p>The base price with no extras for this package is £470</p><br>
<p>To order a computer please fill in the form below and you will recieve and email back within 48 Hours with order conformation and order final price and a link to pay for your order.</p>
<h4>Choose any Upgrades you want:</h4>
<p>Please note if you purchase and upgrades the packages default item will not be included and replaced with the upgraded part.</p>
<form method="POST" action="thanks.php" name="Order Home Package">
<input type="TEXT" name="name" value="Enter Name">
<input type="TEXT" name="email" value="Enter Email Address">
<h5>CD Drive Upgrades:</h5>
<form method="post" action="thanks.php" name="CD Drive Upgrades">
<select name="CD Drive Upgrade">
<option value="No Upgrades">No Upgrades
<option value="1 X DVD-RW All Formats">1 X DVD-RW All Formats [Add £25]
<option value="2 X DVD-RW All Formats">2 X 1 X DVD-RW All Formats [Add £35]
</select>
<h5>Memory Upgrades:</h5>
<form method="post" action="thanks.php" name="Memory Upgrades></form>">
<select name="Memory Upgrades">
<option value="No Upgrades">No Upgrades
<option value="2 x 512MB - 1GB Memory [Add £30]">2 x 512MB - 1GB Memory [Add £30]
<option value="2 x 1GB - 2GB Memory [Add £60]">2 x 1GB - 2GB Memory [Add £60]
<option value="Degrade Memory to 256MB [Take £15]">Degrade Memory to 256MB [Take £15]
</select>
<h5>Case Upgrades:</h5>
<form method="post" action="thanks.php" name="Case Upgrades></form>">
<select name="Case Upgrades">
<option value="No Upgrades">No Upgrades
<option value="See Through Window [Add £20]">See Through Window [Add £20]
<option value="See Through Window and Cold Cathode CCFL Lights [Add £35]">See Through Window and Cold Cathode CCFL Lights [Add £35]
</select>
<h5>Hard Disk Upgrades:</h5>
<form method="post" action="thanks.php" name="Hard Disc Upgrades></form>">
<select name="Hard Disk Upgrades">
<option value="No Extras">No Extras
<option value="120GB Hard Disk [Add £20]">120GB Hard Disk [Add £20]
<option value="160GB Hard Disk [Add £35]">160GB Hard Disk [Add £35]
</select>
<h5>Networking Upgrades:</h5>
<form method="post" action="../Website/steve/thanks.php" name="Networking Upgrades></form>">
<select name="Networking Upgrades">
<option value="No Extras">No Extras
<option value="Gigabit Ethernet [Add £35]">Gigabit Ethernet [Add £35]
<option value="Built In Wireless [Add £35]">Built In Wireless [Add £35]
</select>
<br>

<br>
<br>
<input type="SUBMIT" name="Submit" value="Submit" src="../Website/steve/thanks.php">
<input type="RESET" name="Reset">
</form>
</body>
</html>
Thanks
Steven
__________________

DJ Stephen is offline   Reply With Quote
Old 02-18-2006, 11:02 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: Custom Computer Ordering System,

ummm...
I think I know what you mena..
but try this
Code:
<html>
<script>
update_price()
{
  var cost = 0;
  if (document.form1.processor.value == "2") {then cost = cost + 50; }
  if (document.form1.processor.value == "2.5") {then cost = cost + 60; }
  if (document.form1.processor.value == "3") {then cost = cost + 70; }
  if (document.form1.ram.value == "256") {then cost = cost + 50; }
  if (document.form1.ram.value == "512") {then cost = cost + 75; }
  document.form1.total.value = cost;
}
</script>
<body>
<form name="form1" method="post">
<select name="Processor" onchange="update_price();">
  <option value="2">2 GHz</option>
  <option value="2.5">2.5 GHz</option>
  <option value="3">3 GHz</option>
</select>
<select name="ram" onchange="update_price();">
  <option value="256">256 MB</option>
  <option value="512">512 MB</option>
</select>
<input type="text" name="total" />
<submit>
</form>
</body>
vague... but I hope you get the idea...

you could also have to total in a changable div and have it also stored in a hidden form element, as you can of course, (when using an input box) change the total value.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 02-18-2006, 11:16 AM   #3
Fully Optimized
 
Join Date: Jun 2005
Posts: 3,275
Send a message via ICQ to DJ Stephen Send a message via AIM to DJ Stephen Send a message via MSN to DJ Stephen Send a message via Yahoo to DJ Stephen
Default Re: Custom Computer Ordering System,

Thanks for the info root, your a saviour, i get the code.
DJ Stephen is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:02 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0