Hi Guys,

I spend hours trying to find the mistake I made, but cannot find it. It is part of a simple accounting thing I m trying to make for the fun of it. What it should do is to add the amount ex vat to the vat amount and put the answer in the next textfield, so it is possible to check by the eye whether the invoice is indeed that amount of money. But, is does not work an I don't know why. Anybody a suggestion? I know I do not validate whether the value is a number or not, but that does not seem to be the problem. I tried the part with another event handler and function which worked. But this part seperatly, nothing.

Javascript is rather new to me, so I would very much appreciate an explanation why it went wrong.

Looking forward to a reply.

The code is as follows:
Code:
<html>
<head>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
<script type="text/javascript">
function transfer_ex()
{
var amount_ex = parseFloat(document.getElementById('amount_ex').value) ;
var vat = parseFloat(document.getElementById('vat').value) ;
document.getElementById('total_amount').value= amount_ex + vat;
return;
}
</script>
</head>
<body>
<form name = "invoice" action="welcome.php" method="post"><br>
Amount ex VAT: <input type="text" id="amount_ex" name="amount_ex" value=""  onkeyup=transfer_ex()/><br>
VAT: <input type="text" id="vat" name="vat" value="" onkeyup=transfer_ex()/><br>
Invoice amount: <input type="text" id="total_amount" value="-" /><br>
</form>
</body>
</html>
Looking forward to any reply

Arie