View Full Version : I cant find this , can anyone help
Fullwebservice
08-11-2002, 09:35 PM
Hi,
I have seen this script before but i cant find it now,
I'll explain a little more
Say you come to my site and it's a hosting site and yo want a quote on a custom package
I have the feild on the said saying this
[form ]
Domain name []Yes []No
Space []50 MB []100 MB []200 MB []500 []1GIG []2GIG
BW ::: []500 MB []1000 MB []2000 MB []5000 []10000 []20000
Calculate Total Price
Total Price = [$__]
[/form ]
if they tick a box it equles a Price and same with the others and at the End the price is added up so they know how much it costs
Thankx for the Help
(the []=tick boxes)
adios
08-12-2002, 12:17 AM
Hope this is self-explanatory:
<html>
<head>
<title>untitled</title>
<script type="text/javascript" language="javascript">
var prices = new Object();
prices['domain_name'] = new Object();
prices['server_MB'] = new Object();
prices['server_BW'] = new Object();
//////////////////////////////////////
prices['domain_name']['yes'] = 49.99;
prices['domain_name']['no'] = 0.00;
//////////////////////////////////////
prices['server_MB']['50'] = 9.99;
prices['server_MB']['100'] = 16.99;
prices['server_MB']['200'] = 33.99;
prices['server_MB']['500'] = 72.99;
prices['server_MB']['1000'] = 133.99;
prices['server_MB']['2000'] = 249.99;
//////////////////////////////////////
//////////////////////////////////////
prices['server_BW']['500'] = 22.00;
prices['server_BW']['1000'] = 33.99;
prices['server_BW']['2000'] = 54.99;
prices['server_BW']['5000'] = 139.99;
prices['server_BW']['10000'] = 229.99;
prices['server_BW']['20000'] = 479.99;
//////////////////////////////////////
function subtotalit(field) {
var el, e = 0, subtotal = 0, f = field.form;
while (el = f[e++])
if (el.type == 'radio' && el.checked && prices[el.name])
subtotal += parseFloat(prices[el.name][el.value]);
subtotal = new String(Math.round(subtotal*100)/100);
if (subtotal.indexOf('.') == -1) subtotal += '.00';
f.totalprice.value = '$' + subtotal;
}
</script>
</head>
<body>
<form>
<font size="5">Custom Hosting Package_____</font>
<strong>Total price: </strong>
<input type="text" name="totalprice" size="8" readonly="readonly"
onfocus="if(!this.readOnly)this.blur()" />
<input type="reset" value="CLEAR" />
<hr />
<strong>Domain Name: </strong><br />
<input type="radio" name="domain_name" value="yes" onclick="subtotalit(this)" /> yes<br />
<input type="radio" name="domain_name" value="no" onclick="subtotalit(this)" /> no<hr />
<strong>Server space: </strong><br />
<input type="radio" name="server_MB" value="50" onclick="subtotalit(this)" /> 50 MB<br />
<input type="radio" name="server_MB" value="100" onclick="subtotalit(this)" /> 100 MB<br />
<input type="radio" name="server_MB" value="200" onclick="subtotalit(this)" />200 MB<br />
<input type="radio" name="server_MB" value="500" onclick="subtotalit(this)" /> 500 MB<br />
<input type="radio" name="server_MB" value="1000" onclick="subtotalit(this)" /> 1 GB<br />
<input type="radio" name="server_MB" value="2000" onclick="subtotalit(this)" /> 2 GB<hr />
<strong>Bandwidth: </strong><br />
<input type="radio" name="server_BW" value="500" onclick="subtotalit(this)" /> 500 MHz<br />
<input type="radio" name="server_BW" value="1000" onclick="subtotalit(this)" /> 1000 MHz<br />
<input type="radio" name="server_BW" value="2000" onclick="subtotalit(this)" /> 2000 MHz<br />
<input type="radio" name="server_BW" value="5000" onclick="subtotalit(this)" /> 5000 MHz<br />
<input type="radio" name="server_BW" value="10000" onclick="subtotalit(this)" /> 10,000 MHz<br />
<input type="radio" name="server_BW" value="20000" onclick="subtotalit(this)" /> 20,000 MHz<hr />
</form>
</body>
</html>
Fullwebservice
08-12-2002, 12:22 AM
OMG i cant belive you did all that for me , it works great thats what i was looking for
Thankx a million :thumbsup: :thumbsup: :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.