Sådan ?-)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Tomt dokument</title>
<meta name="keywords" content="roenving,
http://www.eksperten.dk/spm/722198"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;margin:0px;border:0px;padding:0px;font-family:tahoma,verdana,arial,sans-serif;font-size:small;}
</style>
<script language="javascript" type="text/javascript">
function tilfoejKoeb(elm){
var f = elm.form;
var fra = f.vinSelect;
fraSel = fra.selectedIndex;
if(fraSel == -1) return;
var til = f.koebSelect;
var opts = til.options;
var num = +f.antal.value;
if(0 >= num)return;
var fraVal = fra.options[fraSel].value.split("|");
var val = num + "|" + fraVal[0] + "|" + fraVal[1];
var txt = num + " * " + fraVal[0] + " à kr. " + fraVal[1] + " = kr. " + (num * +fraVal[1]);
opts[opts.length] = new Option(txt,val);
opdaterIalt(til,f);
}
function fjernFraBestilling(elm){
var f = elm.form;
var fra = f.vinSelect;
var til = f.koebSelect;
var tilSel = til.selectedIndex;
if(tilSel == -1) return;
var val = til.options[tilSel].value.split("|");
f.antal.value = val[0];
var selVal = val[1] + "|" + val[2];
for(i=0; fra.length > i; i++){
if(fra.options[i].value == selVal){
fra.options[i].selected = true;
break;
}
}
til.options[tilSel] = null;
opdaterIalt(til,f);
}
function opdaterIalt(til,f){
var flt = document.getElementById("ialt"), sum = 0, val;
for(i=0;til.length>i;i++){
val = til.options[i].value.split("|");
sum += +val[0] * +val[2];
}
flt.firstChild.nodeValue = sum;
}
</script>
</head>
<body>
<br>
<form id="minForm" name="minForm">
<table>
<tr>
<td>
<select name="vinSelect" size="10" id="minSelect">
<option value="vin1|100">vin 1 à 100 kr.<br>
<option value="vin2|75">vin 2 à 75 kr.<br>
<option value="vin3|500">vin 3 à 500 kr.<br>
<option value="vin4|150">vin 4 à 150 kr.<br>
<option value="vin5|45">vin 5 à 45 kr.<br>
<option value="vin6|70">vin 6 à 70 kr.<br>
<option value="vin7|66">vin 7 à 66 kr.<br>
<option value="vin8|100">vin 8 à 100 kr.<br>
<option value="vin9|100">vin 9 à 100 kr.<br>
<option value="vin10|100">vin 10 à 100 kr.<br>
<option value="vin11|100">vin 11 à 100 kr.<br>
<option value="vin12|100">vin 12 à 100 kr.<br>
</select></td>
<td style="text-align:center">
<button onclick="tilfoejKoeb(this);">Føj til bestilling » »</button><br><br>
<button onclick="fjernFraBestilling(this);">« « Fjern fra bestilling</button><br><br>
Antal: <input type="text" name="antal" size="5" value="0" style="text-align:right;" onclick="this.value='';">
</td>
<td>
<select size="10" name="koebSelect" style="width:200px;">
</select>
</td>
</tr>
<tr>
<td colspan="3" style="text-align:center;font-size:large;">
Pris ialt: Kr.: <span id="ialt">0</span>,-</td>
</tr>
</table>
</form>
</body>
</html>