I have a JavaScript event which calculates a price of something according to 2 variables (price and days that the product is used). The function is called on the 2 input elements like this: onkeyup=calc(this.form)
, this works like a charm.
I've connected a DB with these 2 values and echo-ed them as values of the two input elements (which is successful) and added this to make the function happen when the page is loaded:
<script type="text/javascript">
window.onload = function()
{
calc(form);
};
</script>
The problem is that the result of the calculation doesn't show up until I do something with one of the input elements.
The live version can be seen over here: http://www.websane.nl/macbook/opgeslagen.php?id=1
Do you know what the problem is?