Her er hele min side der hedder salgside.html - jeg får stadig fejl: total er ikke defineret.
<html>
<html>
<header>
<script language=\'javascript\'>
var nu = new Date();
var ordrenummer = nu.valueOf();
</script>
</header>
<body>
<IMG SRC=\"giffen2.jpg\" WIDTH=475 HEIGHT=44><br>
<font size=\"2\" face=\"Lucida Calligraphy\">Michael G. Landmark, Hestkøb Vænge 33, DK-3460 Birkerød - Tlf 4581 4024 <a href=\"mailto:mglandmark@get2net.dk\">E-post</a></font>
<table width=\"75%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\">
<tr><!-- Row 1 -->
<td>Beskrivelse: \"Landmark - Aner og etterkommere <br>
samlet av Michael G. Landmark\" i to bind<br>
<u>Danske kroner 450,00</u> inklusive moms og <br>
forsendelse som \'økonomibrev\' i Danmark.
</td>
<td>
<img src=\"bogen.gif\" width=\"89\" height=\"117\" alt=\"\" border=\"0\" align=\"\"><br>
Vare nr 1</td>
</tr>
<tr><!-- Row 2 -->
<td> Beskrivelse: \"Landmark - Aner og etterkommere <br>
samlet av Michael G. Landmark\" i to bind - inklusive
<a href=\"om_cd.html\">CD-ROM</a> <br>
<a name=\"cd\"></a><u>Danske kroner 635,00 </u>inklusive moms og <br>
forsendelse som \'økonomibrev\' i Danmark.
</td>
<td></a>
<img src=\"CDROM2.gif\" width=\"45\" height=\"26\" alt=\"\" border=\"0\" align=\"\"> <img src=\"bogen.gif\" width=\"89\" height=\"117\" alt=\"\" border=\"0\" align=\"\"><br>
Vare nr 2</td>
</tr>
</table>
<font size=\"3\" face=\"Arial\" color=\"#0000FF\"><b>Indkøbskurv</b></font><br>
Venligst indtast ønsket antal!
<form name=\"salg\" action=\"java script:udregn()\" method=\"post\">
<input name=\"antal1\" type=text value=\"\" size=\"3\">Vare nr 1 til Pris:<a id=\"pris1\">450</a> D.kr.<br>
<input name=\"antal2\" type=text value=\"\" size=\"3\">Vare nr 2 til Pris:<a id=\"pris2\">635</a> D.kr.
<input type=\"submit\" value=\"Beregn\">
</form><Br>
<div id=\"sum\"></div>
---------
debugging:
<script language=\"JavaScript\" type=\"text/javascript\">
function udregn(){
var ant1 = parseFloat( document.salgsiden.antal1.value ) ;
var ant2 = parseFloat( document.salgsiden.antal2.value ) ;
alert( \"strengen \'\" +document.salgsiden.antal1.value +\"\' gav \" +ant1 );
alert( \"strengen \'\" +document.salgsiden.antal2.value +\"\' gav \" +ant2 );
var pr1 = parseFloat( document.all[\'pris1\'].innerHTML );
var pr2 = parseFloat( document.all[\'pris2\'].innerHTML );
var samlet1 = ant1 * pr1 ;
var samlet2 = ant2 * pr2 ;
var total = samlet1 + samlet2 ;
alert( \"total er: \" +total ); // NY LINIE
sum.innerHTML=\"Samlet pris: \" + total + \" D.kr.\"
}
</script>
<br>
<font size=\"2\" face=\"arial\" color=\"#FF6600\">Returret: Beskadigede eller mangelfulde varer kan returneres for ombytning inden 8 dage.<b></b></font>
<form action=\"
https://pay.freeway.dk/secure/capture.asp\" method=\"POST\">
<table>
<tr>
<td>Merchantnumber</td>
<td><input type=\"text\" name=\"MerchantNumber\" value=\"\" size=\"15\"></td>
</tr>
<tr>
<td>Beløb i kr.</td>
<td>
<script>
document.write(\'<input type=text name=\"Amount\" value=\"\'+total+\'\" size=15>\')
</script>/td>
</tr>
<tr>
<td>Valuta</td>
<td><input type=text name=\"Currency\" value=\"208\"></td>
</tr>
<tr>
<td>Kortnummer</td>
<td><input type=text name=\"CardNumber\" size=20></td>
</tr>
<tr>
<td>Udløbsdato (MM/ÅÅ)</td>
<td><input type=text name=\"ExpireMonth\" size=2 maxlength=2 value=\"\"> /
<input type=text name=\"ExpireYear\" size=2 maxlength=2 value=\"\"></td>
</tr>
<tr>
<td valign=top>Ordrenummer</td>
<td>
<script>
document.write(\'<input type=text name=\"OrderNumber\" value=\"\'+ordrenummer+\'\" size=25>\')
</script>
<br> <br>
<input type=hidden name=\"AcceptURL\" value=\"
http://shop.freeway.dk/accept.asp\"><input type=hidden name=\"DeclineURL\" value=\"
http://shop.freeway.dk/decline.asp\"></td>
</tr>
</table>
</form>
</body>
</html>