Jeg smider lige koderne.
Bestillingsdelen :
<script type="text/javascript" language="javascript">
priser = new Array();
priser[0] = 0;
priser[1] = 12.00;
priser[2] = 7.00;
priser[3] = 6.00;
priser[4] = 28.00;
priser[5] = 35.00;
priser[6] = 39.00;
priser[7] = 45.00;
priser[8] = 58.00;
priser[9] = 55.00;
priser[10] = 75.00;
Og så videre .......
function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
}
function updtotal(){
samletantal = 0;
samletpris = 0;
for (var i=1; i<priser.length; i++) {
eval("samletantal += (document.f1.antal"+i+".value-0);");
eval("samletpris += (document.f1.total"+i+".value-0);");
}
document.f1.samletantal.value = samletantal;
document.f1.total.value = samletpris;
}
function updatefield(id){
eval("antal = document.f1.antal"+id+".value;");
pris = priser[id];
p = antal*pris;
p = CurrencyFormatted(p);
eval("document.f1.total"+id+".value = p;");
updtotal();
}
function L(){
for (var i=1; i<priser.length; i++) {
eval("document.f1.antal"+i+".value = '0';");
eval("document.f1.total"+i+".value = '0';");
}
updtotal();
}
</script>
Maildelen:
<FORM name=f1 method=post action="
http://scripts.unoeuro.com/formmail/formmail.php"> <input type=hidden name="recipient" value="mail@festgaarden.dk">
<input name=redirect type=hidden value="
http://www.festgaarden.dk/tak.htm"> <INPUT name=subject type=hidden value="Forespørgsel">