I am in need of a Javascript which will allow the user to input information in an input field to allow them to determine the cost of a particular product and then display the result of the calculation. I have a Javascript I am using now but I would like for the cost to display automatically and not have to click a submit button.
This is the Javascript I am using now.
<head>
<title></title>
</head>
<body>
</body>
</html><html>
<head>
<title>Input tutorial</title>
<script language=”javascript”>
function addNumbers()
{
var val1 = parseInt(document.getElementById(“value1”).value);
var val2 = parseInt(document.getElementById(“value2”).value);
var ansD = document.getElementById(“answer”);
ansD.value = val1 * val2
}
</script>
</head>
<body>
<input type=”text” id=”” name=”value1″ value=””/>
<input type=”text” id=”” name=”value2″ value=””/>
<input type=”button” name=”Sumbit” value=”Click here” onclick=”javascript:addNumbers()”/>
<input type=”text” id=”” name=”answer” value=””/;>
</body>
</html> </BODY>
</HTML>
Thanks