Code:
<!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>
<style type="text/css">
#wrap{
width:400px;
margin:0 auto;
text-align:left;
margin-top:8px;
padding:5px;
background:#fff;
font-family:AvenirLTStd, Arial, Helvetica, sans-serif;
font-size:13px;
line-height:16px;
}
#wrap .cont_details fieldset,.cont_order fieldset{
margin:10px;
padding:20px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
border-radius: 10px;
}
#wrap legend{
font-size:16px;
font-family:Georgia, "Times New Roman", Times, serif;
color:#000;
font-weight:bold;
font-style:italic;
padding-bottom:10px;
}
#wrap .cont_details input{
margin-bottom:10px;
color:#000;
}
#wrap .input1:hover,.input1:active{
}
#wrap label{
display:block;
font-size:12px;
color:#000;
font-weight:bold;
}
#wrap label.inlinelabel
{
display:inline;
}
#wrap .cont_order input{
margin-bottom:5px;
}
#wrap .cont_order p{
padding-top:5px;
}
#wrap input[type="radio"]
{
margin-top:8px;
margin-bottom:8px;
}
#wrap input[type="text"]:hover,
#wrap input[type="text"]:active {
background-color: #FAF398;
}
#wrap input#submit
{
margin:10px;
padding-left:20px;
padding-right:20px;
padding-top:10px;
padding-bottom:10px;
}
#wrap div#LignumPrice
{
padding:10px;
font-weight:bold;
background-color:#ff0;
}
#wrap label.radiolabel
{
font-weight:normal;
display:inline;
}/*<![CDATA[*/
/*]]>*/
</style>
<script type="text/javascript">
/*<![CDATA[*/
/*
This source is shared under the terms of LGPL 3
www.gnu.org/licenses/lgpl.html
You are free to use the code in Commercial or non-commercial projects
*/
//Set up an associative array
//The keys represent the Lignum type
//The value represents the cost of the Lignum i.e. Lemon Lignum is $5,Dobash Lignum is $9
//We use this this array when the user selects a Lignum from the form
var Lignum_prices= new Array();
Lignum_prices["None"]=0;
Lignum_prices["LV4.75"]=180;
Lignum_prices["LV4.875"]=180;
Lignum_prices["LV5"]=180;
Lignum_prices["LV5.25"]=180;
Lignum_prices["LV5.5"]=180;
//Set up an associative array
//The keys represent the Quantity type
//The value represents the cost of the Quantity i.e. Lemon Quantity is $5,Dobash Quantity is $9
//We use this this array when the user selects a Quantity from the form
var Quantity_prices= new Array();
Quantity_prices["L0"]=0;
Quantity_prices["L1"]=1;
Quantity_prices["L2"]=2;
Quantity_prices["L3"]=3;
Quantity_prices["L4"]=4;
Quantity_prices["L5"]=5;
var Lignum2_prices= new Array();
Lignum2_prices["None"]=0;
Lignum2_prices["LV4.75"]=179;
Lignum2_prices["LV4.875"]=181;
Lignum2_prices["LV5"]=182;
Lignum2_prices["LV5.25"]=183;
Lignum2_prices["LV5.5"]=184;
var Quantity2_prices= new Array();
Quantity2_prices["L0"]=0;
Quantity2_prices["L1"]=1;
Quantity2_prices["L2"]=2;
Quantity2_prices["L3"]=3;
Quantity2_prices["L4"]=4;
Quantity2_prices["L5"]=5;
function calculateTotal1(id1,id2,id3){
var s1=document.getElementById(id1),a1=window[id1+'_prices'],s2=document.getElementById(id2),a2=window[id2+'_prices'],t=document.getElementById(id3),v1,v2;
if (s1&&a1 instanceof Array,s2&&a2 instanceof Array&&t){
v1=a1[s1.value]||0;
v2=a2[s2.value]||0
t.style.display='block';
t.innerHTML = "£"+v1*v2;
}
}
/*]]>*/
</script>
</head>
<body>
<form action="" id="saleform" onsubmit="return false;">
<div>
<div class="cont_order">
<fieldset>
<div align="center">
<table width="675" cellpadding="0" cellspacing="4">
<tr>
<td width="225" align="center" valign="top"> </td>
<td width="250" align="center" valign="top"><b>SIZE</b></td>
<td width="100" align="center" valign="top"><b>QTY</b></td>
<td width="100" align="center" valign="top"><b>PRICE</b></td>
</tr>
<tr>
<td width="225" align="center" valign="top"><label >LIGNUM VITAE</label></td>
<td width="250" align="center" valign="top">
<select id="Lignum" name='Lignum' onchange="calculateTotal1('Lignum','Quantity','LignumPrice')">
<option value="None">Select Size</option>
<option value="LV4.75">Set of 3 - 4 3/4"</option>
<option value="LV4.875">Set of 3 - 4 7/8"</option>
<option value="LV5">Set of 3 - 5"</option>
<option value="LV5.25">Set of 3 - 5 1/4"</option>
<option value="LV5.5">Set of 3 - 5 1/2"</option>
</select>
</td>
<td width="100" align="center" valign="top">
<select id="Quantity" name='Quantity' onchange="calculateTotal1('Lignum','Quantity','LignumPrice')">
<option value="L0">QTY</option>
<option value="L0">0</option>
<option value="L1">1</option>
<option value="L2">2</option>
<option value="L3">3</option>
<option value="L4">4</option>
<option value="L5">5</option>
</select>
</td>
<td width="100" align="center" valign="top">
<div id="LignumPrice"></div>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<div align="center">
<table width="675" cellpadding="0" cellspacing="4">
<tr>
<td width="225" align="center" valign="top"> </td>
<td width="250" align="center" valign="top"><b>SIZE</b></td>
<td width="100" align="center" valign="top"><b>QTY</b></td>
<td width="100" align="center" valign="top"><b>PRICE</b></td>
</tr>
<tr>
<td width="225" align="center" valign="top"><label >LIGNUM VITAE 2</label></td>
<td width="250" align="center" valign="top">
<select id="Lignum2" name='Lignum2' onchange="calculateTotal1('Lignum2','Quantity2','LignumPrice2')">
<option value="None">Select Size</option>
<option value="LV4.75">Set of 3 - 4 3/4"</option>
<option value="LV4.875">Set of 3 - 4 7/8"</option>
<option value="LV5">Set of 3 - 5"</option>
<option value="LV5.25">Set of 3 - 5 1/4"</option>
<option value="LV5.5">Set of 3 - 5 1/2"</option>
</select>
</td>
<td width="100" align="center" valign="top">
<select id="Quantity2" name='Quantity2' onchange="calculateTotal1('Lignum2','Quantity2','LignumPrice2')">
<option value="L0">QTY</option>
<option value="L0">0</option>
<option value="L1">1</option>
<option value="L2">2</option>
<option value="L3">3</option>
<option value="L4">4</option>
<option value="L5">5</option>
</select>
</td>
<td width="100" align="center" valign="top">
<div id="LignumPrice2"></div>
</td>
</tr>
</table>
</fieldset>
</div>
</form>
</div><!--End of wrap-->
</body>
</html>
Bookmarks