Mezzo said:
Is there any way to create a calculated field in Frontpage 2000? I
have an order form that I'd like to include the amount due based on
quantity x unit price, and then have a total. Any help would be
appreciated!
This code will do a calculation. Just paste it into the HTML view of
FrontPage.
Amend the function to do what you want, e.g.
Addition
result.value = (+val1.value) + (+val2.value)
OR Multiplication
result.value = (+val1.value) * (+val2.value)
<html>
<head>
<script type="text/javascript">
function sendform()
{
with (document.form1)
{ result.value = (+val1.value) / (+val2.value) }
// other stuff here
}
</script>
</head>
<body>
<form name="form1" action="">
<table>
<tr>
<td>Dollar value: </td>
<td><input type="text" id="val1" value="10"/></td>
</tr>
<tr>
<td>Divide by: </td>
<td><input type="text" id="val2" value="3" /></td>
</tr>
<tr>
<td>Result of Division: </td>
<td><input type="text" id="result" size="20" /></td>
</tr>
</table>
<input type="button" id="submit" value=" Send "onclick="sendform()" />
</form>
</body>
</html>